Hello.
I'm printing a LastName which has a maximum of 18 characters.
In Position 21 (starting position 1 from first character of Lastname) I need to print an ID number.
So, if LastName is Sotherland and my ID number is 1234, on the printed line I would have (starting in position 1): Sotherland 1234 (with 10 spaces after Sotherland).
I have the following code but it's adding an extra space after the space value. I know this as I replaced the space value with R and my result was
Sotherland R R R R R R R R R R 1234.
Here's my code.
How can I get rid of the extra space each time the template is called?
Template Calling Block.
Code:
<fo:block>
<xsl:value-of select="EOB/PROVIDER/NUMBER"/>
<xsl:variable name="strLength" select="19 - string-length(EOB/PROVIDER/NUMBER)"/>
<xsl:if test="EOB/PROVIDER/EXTERNALID[.!='']">
<xsl:call-template name="addSpaces">
<xsl:with-param name="count">
<xsl:value-of select ="$strLength"/>
</xsl:with-param>
</xsl:call-template>
<xsl:value-of select="EOB/PROVIDER/EXTERNALID"/>
</xsl:if>
</fo:block>
Template Code
Code:
</xsl:template>
<xsl:template name="addSpaces">
<xsl:param name="count"/>
& # 1 6 0 ;
<xsl:if test="$count>0">
<xsl:call-template name="addSpaces">
<xsl:with-param name="count" select="($count)-1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
NOTE: I'm using "& # 1 6 0 ;" with spaces in between just to show you the value I'm using for a space as it shows up as a space on that line if I don't.
Thanks,
Rita