[xsl] Special Characters for Position Sepcific Output.

Subject: [xsl] Special Characters for Position Sepcific Output.
From: "Avula, Raj" <RAvula@xxxxxxxxxxx>
Date: Thu, 26 Jul 2001 17:15:04 -0700
		I am writing XSL to generate Text Report which is position
	That is each attribute/element has to occupy certain no. of
	(eg: Customer ID should occupy 1-10 characters, and firstname 11-35
	If the input is less than the specified charactes, I am appending
the spaces.)

	Sample XML:
<customer id="100">

	I am using follwoing command to print the first name that should
occupy 25 characters.
		<xsl:variable name="twentyfive_spaces" select="'
'" />
		<xsl:value-of select="substring(concat(name/firstname,
$twentyfive_spaces), 1, 25)" />

	But the problem is if there are any special characters in the input,
then the ouput is
	exceeding 25 characters.

Sample ouput in normal case is
*Steve                    *

In case of input like <firstname>St&amp;eve</firstname>, output will be
*St&amp;eve                   *
	which exceeds 25 characters. 
Please let me know, how can I handle this condition in XSL.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread