This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: select="substring-before($str,"'")" !!!


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]