[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: translate quot to apos
Similar problem here: I have to change all "quote" and "apos" before use the string as a javascript-function argument. So I need to change every "apos" to "\apos" or to "apos apos" and the same with "quote" too. But if I'm not wrong the translate function can substitute one character with only another one and not with two or more: "If the third argument string is longer than the second argument string, then excess characters are ignored" (from http://zvon.org/xxl/XSLTreference/Output/index.html site). Also if I use variables. How to solve this? This is the piece of my xsl file (not working because replacing ' with ' and not with ''): <xsl:variable name="apos">'</xsl:variable> <xsl:variable name="apos2">''</xsl:variable> <xsl:variable name="quote">"</xsl:variable> <xsl:variable name="quote2">""</xsl:variable> <xsl:variable name="Abstract1" select="normalize-space(.)"/> <xsl:variable name="Abstract2" select="translate($Abstract1,$apos,$apos2)"/> <xsl:variable name="Abstract3" select="translate($Abstract2,$quote,$quote2)"/> <xsl:attribute name="onclick">NewWindow('<xsl:value-of select="$Abstract3"/>')</xsl:attribute> Thank you, Andrea > Best way is to use variables: > > <xsl:variable name="quot">"</xsl:variable> > <xsl:variable name="apos">'</xsl:variable> > <xsl:value-of select="translate(Tag1, $quot, $apos)"/> > > Mike Kay 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
|