Page output JSON for Ajax usage
This is an open discussion with 2 replies, filed under XSLT.
Search
Have you tried the text output method?
<xsl:output method="text" omit-xml-declaration="yes" encoding="UTF-8" />
Thanks, Michael.
omit-xml-declaration="yes"
did the trick. I didn't know about it.
Create an account or sign in to comment.
Hello.
Is there a way for a Symphony page to output nice and clean JSON?
I'm using jQuery to make an Ajax call to retrieve dates of events in JSON format:
The page XSLT is transforming the resulting DSs' XML very well but the result contains an XML declaration like this:
This is definitely the cause of failure for the Ajax call. I noticed that the XML declaration
<?xml version="1.0"?>
is automatically inserted after the XSLT processing of the XML, line 158 inclass.xsltprocess.php
:Any suggestions?
Thank you.