<xsl:template match="image"> <img> <xsl:attribute name="src"> <xsl:apply-templates /> </xsl:attribute> </img> </xsl:template>
This XSL gives me something like <img src="picture.jpg"/>, which doesn't work, because the quotation marks aren't escaped. It's inside Javascript, so it has to be <img src=\"picture.jpg\"/> Replacing it with """ doesn't work for some reason, and I can't put a backslash in that template without getting an error. Glen Mazza wrote: > > What do you mean by "escape"? Using a backslash as you have below, or > replacing it with the macro """? > I think you want the latter--and if you do that, it should work just as > nicely as the < and > 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 <img src=\"imagename.jpg\" / >. This template works, but it >> doesn't escape the quotation marks: >> >> <xsl:template match="image"> >> <img> >> <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 >> >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Escaping-double-quotation-marks-in-XSL-tf4680435.html#a13377638 Sent from the Apache XML - General mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]