Hi, i am trying to put a peace of xhtml inside xml for an ajax application. The problem i have is that my server script (php) sees the xhtml inside the xml as other xml. I think i need to wrap the xhtml node inside a CDATA tag but i cant seem to find out how. My xhtml gets generated by a xsl template. I convert one tag of the source into some xhtml like so :
Code:
<xsl:template match="status">
<xsl:variable name="translations" select="$lang.vote/translations/info[lang($language)]" />
<xsl:variable name="status" select="." />
<xsl:variable name="message" select="$translations/status[@code=$status]" />
<xsl:copy>
<xsl:call-template name="statusText">
<xsl:with-param name="status">
<xsl:value-of select="$status" />
</xsl:with-param>
<xsl:with-param name="message">
<xsl:value-of select="$message" />
</xsl:with-param>
</xsl:call-template>
</xsl:copy>
</xsl:template>
i tried to add cdata-section-elements="status" to my xsl:output tag but that didn't do anything. I think i can put the cdata in my statusText template but that template also gets used by pages that don't use ajax. Any help would be apreciated. P.S. What i am trying to do is convert my xml to json, i found an xsl stylesheet that converts xml to json, but there i also had the same problem, so now i am trying to retrieve the xml in php and then use in php convert the xml to an array and then json_encode it, if this is isn't logical please give me an alternative :)