Escaping quotes from content
I am using XSL to translate an XML document from a newswire into an SQL insert statment so that the feed can be loaded into a MySQL database.
I have the query actually building without issue, but the problem is that the quotes are messing up when the query fires.
My XSL file is as such:
<xsl:template match="IndexStoryHead">
INSERT INTO newsfeed VALUES (NULL,'<xsl:value-of select="(.)"/>',
</xsl:template>
<xsl:template match="Story">
'<xsl:value-of select="(.)"/>',0);
</xsl:template>
What is outputted is:
INSERT INTO newsfeed VALUES (NULL,'Eight charged in connection with Boxing Day shooting death of Toronto teen', ' TORONTO - Eight people are facing charges, including second-degree murder, in the shooting death of an innocent teenage girl in Toronto on Boxing Day. Toronto police Chief Bill Blair says three of the accused, including one youth, are charged with second-degree murder in the death of 15-year-old Jane Creba. ',0);
What I need to happen is for the single and double quotes get escaped out in the query. How would I go about doing this?
TIA,
Phil
|