Quoting quotes?

Subject: Quoting quotes?
From: Danny Vint <dvint@xxxxxxxx>
Date: Sat, 21 Oct 2000 16:40:04 -0700
Suppose I want to use the following string:

"Dean. Well, let's see, we have on the bags, Who's on first, What's on
second, I Don't Know is on third ... "

and I need to use it something like this:

<xsl:value-of select="substring-after('Dean. Well, let's see, we have on
the bags, Who's on first, What's on second, I Don't Know is on third ... ',
'bags')"/>

Do you see the problem?

The select attribute uses the " " to contain the attribute value.

then the string-after() function uses the ' ' for the two string value
parameters

but my content string has a bunch of ' in the text! 

So I fix this by:

Now I know that I can change the "" in the select to ' '
and the ' ' in the substring-after() to " "

Ok so that fixes this problem, but what happens if I wanted the string to
contain the "" around the
string like it was a real quotation? Now the swapping of '' for " " doesn't
work and using &quot; and/or &apos; doesn't hide these characters from the
parser - they ar converted to '' an d" just like I had typed the character. 

In UNIX you would use a \" or \' to quote a quote, what is the equivalent
function here?

..dan

---------------------------------------------------------------------------
Danny Vint
http://www.dvint.com

Author: "SGML at Work"  
http://www.slip.net/~dvint/pubs/sgmlatwork.shtml 
 mailto:dvint@xxxxxxx
    


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • Quoting quotes?
    • Danny Vint - Sat, 21 Oct 2000 16:40:04 -0700 <=
      • Mike Brown - Sat, 21 Oct 2000 19:19:09 -0600 (MDT)
      • <Possible follow-ups>
      • Kay Michael - Mon, 23 Oct 2000 09:29:38 +0100