#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    9
    Rep Power
    0

    Special character causing problems in CF8 XML output


    I am sending a query result (query in CF8; data in MS SQL Server 2005) to an XML output (using the and #toString(outputname)#
    tags), using CF8. When the output (in SQL Server as nvarchar) contains special characters like "-40 to 70C" the symbol causes the error;
    ******************************************
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    --------------------------------------------------------------------------------
    An invalid character was found in text content. Error processing resource 'http://localhost/ABSwwwroot/ArchboldData/toXML.c...

    -40
    ******************************************
    How can I get this type of value to display properly?

    Thanks!
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,068
    Rep Power
    9398
    The XML needs to specify the encoding it's using - the same encoding as the . If it's UTF-8 then you need a
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    An alternative is to entity-encode anything that doesn't fit, but that's a hassle and really just not as good.

IMN logo majestic logo threadwatch logo seochat tools logo