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]

Quoting quotes?


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@usa.net
    


 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]