-
eliminating leading spaces after newline
Hi,
I'm trying to format an xml file as a fixed-width file using an XSLT stylesheet.
It's going pretty well, except for one problem with new lines.
I have to create new lines for each group of two repeating lines. To do this,
I'm using this character sequence:  
and this is my output element:
<xsl utput method="text" encoding="UTF-8"/>
The problem I'm encountering is that each line in the result file is spaced
or tabbed in to column 7, as seen below in this excerpt:
24 MONTH HISTORY
BMW/LAND ROVER FINCL S 30478 05/01/1998
2000159892 773
ANCHORBANK, SSB 4664 11/01/1994
1399621960831416 82 .........
"24 MONTH HISTORY" is the header and the rest of the lines are the repeating
ones. But no matter what I do, I can't seem to get rid of the leading spaces.
I have tried "
" instead of " ", using the strip-space() instruction
(which really doesn't apply here, I guess), and different encodings (UTF-16,
ANSI), but with no luck. I'm also trying "normalize-space()" in the XPath
expressions, but this doesn't help either.
Here's an excerpt from my XSLT:
<xsl:template match="credit_line_item">
 
<xsl:value-of select="normalize-space(creditor)"/><![CDATA[ ]]>
<xsl:value-of select="normalize-space(balance_owed)"/><![CDATA[ ]]>
<xsl:value-of select="normalize-space(date_opened)"/><![CDATA[ ]]>
 
<xsl:value-of select="account_number"/><![CDATA[ ]]>
<xsl:choose>
<xsl:when test="payment_amount">
<xsl:value-of select="payment_amount"/>
</xsl:when>
<xsl therwise>0</xsl therwise>
</xsl:choose>
</xsl:template>
Anyone have any ideas? I'm stumped!
TIA,
Paul Klanderud
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks