This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: select="substring-before($str,"'")" !!!
- To: davidc at nag dot co dot uk
- Subject: Re: [xsl] select="substring-before($str,"'")" !!!
- From: Dimitre Novatchev <dnovatchev at yahoo dot com>
- Date: Tue, 16 Jan 2001 05:56:20 -0800 (PST)
- Cc: xsl-list at lists dot mulberrytech dot com
- Reply-To: xsl-list at lists dot mulberrytech dot com
David Carlisle wrote:
> If you do ever need an XPath string containing both " and '
> then you can not do it in a single Xpath string literal, you need to
use
> the concat() function, or a variable.
Yes, this is a good solution, but what to do in the case when the
output will be something like this:
document.writeln('"This is my name." - said Sandra O'Boyle');
In such a case a solution will be to replace any occurence of a quote
and apostrophe with a javascript variable name -- e.g. varQuote and
varApos. We know this is done by calling a recursive named template.
The output then will be:
document.writeln(varQuote + 'This is my name.' + varQuote + ' - said
Sandra O' + varApos + 'Boyle');
The definitions of varQuote and varApos will also have to be generated:
var varQuote = '"';
var varApos = "'";
Dimitre.
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list