Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8345375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:39:16+00:00 2026-06-09T06:39:16+00:00

I have an xml file. <?xml version=1.0 encoding=UTF-8?> <channel> <item>content with special character é</item>

  • 0

I have an xml file.

<?xml version="1.0" encoding="UTF-8"?>
<channel>
    <item>content with special character é</item>
</channel>

Assume that the above is the xml file, except with content from a product catalogue, with a lot more tags and content. This is created using the following process:

  1. call database from coldfusion file
  2. get content from database with procedure and return to coldfusion file
  3. create an xml file in coldfusion (just by using a filename, ex: “filename.xml”)
  4. write the contents to the file by looping through the query in coldfusion and adding product per product to the xml file

This gives me errors when I try to open the file in Firefox (my way of testing the parsing of the xml file). Tells me that I have some special characters that need escaping (“xml not well-formed” or something like that). So I put CDATA tags inside these xml tags, which should clear this up, right?
It doesn’t. It keeps stumbling over special characters, not just the ones that are reserved for xml (&, <, >, ..).

Here’s when I started loosing it. After some trying and testing in creating smaller xml files manually (not through coldfusion), I got it to work, just by dropping the CDATA tags and just inserting the above code. Firefox parses the above code just fine.
So after some thinking, I just copied the entire contents of the faulty file, the original one, to a brand new manually created xml file (.txt –> renamed to .xml) and voila, no more errors.

Can somebody please explain to me how, in this case, 2 seperate files, with the exact same content, copied from the first to the second, get parsed differently. The first one showing multiple errors on special characters, the second one have no problem with these at all..?
Please, someone, before I go berserk at my desk here.. >_>

Edit 1:
When I say special characters, I specifically mean utf-8 characters. I’m not talking about the characters reserved for xml (&, <, >, …), I already escape these.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:39:17+00:00Added an answer on June 9, 2026 at 6:39 am

    There are no special characters in the example you give, just normal ones like c, é, (I suppose space is a bit special), etc.

    I would guess from what you describe that you are using the incorrect encoding. You’re saying it’s UTF-8, but is it really?

    If this is the problem, you’ve three solutions:

    1. Fix the code to write the file in UTF-8.
    2. Fix the code to describe the encoding it’s actually in (do so in both the HTTP headers and the XML declaration).
    3. Keep saying it’s UTF-8, but escape any character outside of the US-ASCII range (U+0000 to U+007F). E.g. you’d output the above as:

    (This dummy line added because the parser seems not to like code blocks right after lists)

    <?xml version="1.0" encoding="UTF-8"?>
    <channel>
        <item>content with special character &#xe9;</item>
    </channel>
    

    Number one is the best to go for, but failing that there’s pros and cons with the other two. In favour of number 2, it won’t escape as many characters that don’t really need to be escaped. In favour of number 3, only UTF-8 and UTF-16 have to be accepted by an XML parser, and faking it this way will work with any character set that’s the same as UTF-8 for the range U+0000 to U+007F, which is a lot of them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file that looks like <?xml version='1.0' encoding='UTF-8'?> <root> <node name=foo1
I have this XML at http://localhost/file.xml : <?xml version=1.0 encoding=utf-8?> <val:Root xmlns:val=http://www.hw-group.com/XMLSchema/ste/values.xsd> <Agent> <Version>2.0.3</Version>
have an xml file like this. <?xml version =1.0 encoding =utf-8?> <menu> <menuNode title=Register
I have an xml file which looks like this <?xml version=1.0 encoding=UTF-8 ?> <BulkDataExchangeRequests
I have the following small file to reproduce the warning: <?xml version=1.0 encoding=UTF-8?> <beans
I have a XML file with code like <?xml version=1.0 encoding=UTF-8?> <?xml-stylesheet href=rss2.xsl type=text/xsl
I have a xml file which has the following header: <?xml version=1.1 encoding=UTF-8?> .
I have an XML file that looks like <?xml version=1.0> <playlist> <name>My Playlist</name> <song>
Here's an example of an XML file created in InfoPath: <?xml version=1.0 encoding=UTF-8?> <?mso-infoPathSolution
I have a XML file. Here is a small version of that. <?xml version=1.0

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.