Subject: RE: [xsl] Special Characters for Position Sepcific Output. From: "Avula, Raj" <RAvula@xxxxxxxxxxx> Date: Thu, 26 Jul 2001 19:00:21 -0700 |
Thanks. It worked perfect Raj > -----Original Message----- > From: William Lam [SMTP:xeenman@xxxxxxxxx] > Sent: Thursday, July 26, 2001 6:06 PM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Re: [xsl] Special Characters for Position Sepcific Output. > > Play with > > xsl:value-of disable-output-escaping="yes" > > It will output & instead of & > > --- "Avula, Raj" <RAvula@xxxxxxxxxxx> wrote: > > > > 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&eve</firstname>, output will be > > *St&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 > > > > > __________________________________________________ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.yahoo.com/ > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Special Characters for Po, Kevin Nardi | Thread | Re: [xsl] Special Characters for Po, Jeni Tennison |
Re: [xsl] parsing error: < ???, Dana Fillhart | Date | [xsl] Multiple Sorting, Sean Kelly |
Month |