Results 1 to 2 of 2
Thread: escape double quotes in result
- Join Date
- Apr 2005
- 1,051
- Thanks
- 0
- Thanked 0 Times in 0 Posts
escape double quotes in result
I'm using the following code to produce a js array, however parts of the result text can contain double quotes.. Is there an easy way to escape them??
Example: say Artist is 'artist "name"'
i want that to convert to 'artist \"name\"'
Code:
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns: <xsl:template <textarea cols='25' rows='25'> var myData = [ <xsl:call-template ]; </textarea> </xsl:template> <xsl:template <xsl:for-each["<xsl:number",<xsl:call-template], </xsl:for-each> </xsl:template> <xsl:template"<xsl:value-of","<xsl:value-of","<xsl:value-of","<xsl:value-of"</xsl:template> </xsl:stylesheet>public string ConjunctionJunction(string words, string phrases, string clauses)
{
return (String)(words + phrases + clauses);
}
<--- Was I Helpfull? Let me know ---<
- Join Date
- Nov 2006
- 1,000
- Thanks
- 0
- Thanked 0 Times in 0 Posts
I messed around with translate() for a bit but it just doesn't appear to be flexible enough. It could be used to convert it to a single quote I suppose but that isn't really what you asked.
After that all I can think of is using contains() to figure out if it had a " and if it does do the escaping.
Sorry, nothing really insightful here.
david_kw