Re: [Announce] Escaping double quotation marks in XSL

Glen Mazza <[email protected]> Tue, 23 Oct 2007 17:48:41 -0400
Newsgroups gmane.text.xml.general
Message-ID <[email protected]>
What do you mean by "escape"? Using a backslash as you have below, or 
replacing it with the macro "&quot;"?
I think you want the latter--and if you do that, it should work just as 
nicely as the &lt; and &gt; are doing for you right now.

HTH,
Glen

caporale schrieb:
> I have XSL inside Javascript.  The XML looks like this:
> <image>imagename.jpg</image>.  Any time that tag's there, the output should
> be &lt;img src=\"imagename.jpg\" / &gt;.  This template works, but it
> doesn't escape the quotation marks:
>
> <xsl:template match="image">
> &lt;img&gt;
> <xsl:attribute name="src">
> <xsl:apply-templates />
> </xsl:attribute>
> </img>
> </xsl:template>
>
> What do I need to do to escape the quotation marks from that?  I've seen
> about 400 examples on-line--none of which actually do what I want.
>
> Thanks,
> Joseph Caporale
>
>
>