[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Special Characters for Position Sepcific Output.

Subject: Re: Special Characters for Position Sepcific Output.
From: "Kevin Nardi" <kevnardi@xxxxxxxxxxx>
Date: Thu, 26 Jul 2001 17:34:38 -0700
sample of output.xsl
If you are outputting straight text, then use <xsl:output method="text" />, and your "&amp;" should be output as "&" (as I understand it...I could be wrong), and your problem is solved.

If you want XML, then what you're getting is what you want. The "&amp;" will be converted to "&" whenever it's run through an XML parser, and it will only be 1 character long.

Hope that helps.

-Kevin

From: "Avula, Raj" <RAvula@xxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: "'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject:  Special Characters for Position Sepcific Output.
Date: Thu, 26 Jul 2001 17:15:04 -0700


Hi, I am writing XSL to generate Text Report which is position specific. That is each attribute/element has to occupy certain no. of characters (eg: Customer ID should occupy 1-10 characters, and firstname 11-35 etc. If the input is less than the specified charactes, I am appending the spaces.)

	Sample XML:
<customer id="100">
	<name>
		<firstname>Steve</firstname>
	</name>
</customer>

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

	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.


Regards, Raj


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




_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.