Luis Majano Forums Notification: Post to Strange Issue with Coldbox Debug

Title: Strange Issue with Coldbox Debug
Thread: Strange Issue with Coldbox Debug
Forum: Need Help?
Conference: ColdBox
User: tberrisford

I am using Spry within Coldbox and ran into a strange issue.

While trying to
create and use an XML data set for Spry sorting I am getting an XML error that
only appears when Coldbox Debugging is turned off. When debugging is on the
page runs fine and no error is returned. When debugging is off I get "XML
Parsing Error: not well-formed"

Any ideas??

Here is the call to my model
cfc...

[code]
<script type="text/javascript">
var dsUsers = new
Spry.Data.XMLDataSet("model/users.cfc?method=getUsersSpry"dataset/row",
{useCache: false });
</script>
[/code]

Here is the function which queries
the db and converts the result to XML via the queryToXML function.

[code]
<cffunction name="getUsersSpry" access="remote" returntype="xml" output="false">
<cfset var GetUserInfoQry = "">
    <cfset var usersXML = "">
    <cfset var
parsedUsersXML = "">
    
    <!--- Query the database and get all the records
--->
    <cfquery name="GetUserInfoQry" datasource="#application.datasource#">
SELECT
      ID, USERNAME, ENCRYPTED_PASSWORD, FIRST_NAME, LAST_NAME,
EMAIL_ADDRESS, ORGANIZATION, ACTIVE_USER_YN,
      LAST_LOGIN_TIMESTAMP,
PASSWORD_CHANGE_REQUIRED_YN, INTERNAL_USER_YN
    FROM USERS
    WHERE ID <> -1
ORDER BY LAST_NAME
    </cfquery>
    
    <cfset toXML =
createObject("component", "toXML")>
      
       <!--- Use the queryToXML
function to convert the query results to xml text.
        'dataset' will be the
name for the root node and 'row'' will be the node that
        repeats for each
row in the query result --->
        <cfset usersXML =
toXML.queryToXML(GetUserInfoQry, "dataset", "row")>
      
        <!---
Convert the XML text into an XMLDocument object since we are returning XML--->
<cfset parsedUsersXML = xmlParse( usersXML ) >
      
    <!--- Don't
include CF debug output. --->
    <cfsetting showDebugOutput = "no">
<!--- Set the content returned so that Spry will recognize it as XML.
Without this line Spry does not recognize the returned value as XML. --->
<cfcontent type="application/xml; charset=UTF-8">
    
    <cfreturn
parsedUsersXML />
    
  </cffunction>
[/code]

http://www.luismajano.com/forums/index.cfm?event=ehMessages.dspMessages&threadid=A84EBB4A-123F-6116-42169C4872A65749