[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: Re: select="substring-before($str,"'")" !!!
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Tue, 16 Jan 2001 05:56:20 -0800 (PST)
substring before
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.