|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How do I drop an apostrophe?
<xsl:variable name="apos">'</xsl:variable> <xsl:value-of select="translate($chars, $apos, '')"/> Mike Kay > -----Original Message----- > From: James Garriss [mailto:jgarriss@xxxxxxxxx] > Sent: 29 November 1999 16:24 > To: xsl-list@xxxxxxxxxxxxxxxx > Subject: How do I drop an apostrophe? > > > Given an XML document like this: > > <foo> > <bar name="Jim's Code">abc</bar> > </foo> > > How do I get a desired output XML document like this: > > <jimscode>abc</jims_code> > > Specifically, I'm looking for how to drop apostrophes. I > have figured out > how to translate (and drop) characters in general using code > like this: > > <xsl:variable name="upperCaseChars" > select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/> > <xsl:variable name="lowerCaseChars" > select="'abcdefghijklmnopqrstuvwxyz'"/> > <xsl:variable name="uCaseCharsPlus" > select="concat($upperCaseChars, ' > /-(),+')"/> > <xsl:variable name="lCaseCharsPlus" > select="concat($lowerCaseChars, '')"/> > > <xsl:variable name="element_name" select="translate(@name, > $uCaseCharsPlus, $lCaseCharsPlus)"/> > <xsl:element name="{$element_name}"> > ... > </xsl:element> > > But I can't get it to work with apostrophes. I have tried > escaping it > using ', ', and ', but no luck. > > BTW, I'm using LotusXSL on NT. > > James Garriss | The MITRE Corporation | jgarriss @ mitre.org > "The second mouse gets the cheese." -- Steven Wright > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








