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

  • SEARCH
  • Home
  • 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 3681266
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:40:16+00:00 2026-05-19T03:40:16+00:00

I’m coding a RSS reader in Javascript using XMLHttpRequest . For some RSS Feeds

  • 0

I’m coding a RSS reader in Javascript using XMLHttpRequest.

For some RSS Feeds I had no problems but in some cases the xmlDocument.firstChild attribute was always NULL

After trying to see the differences between the XML that worked and the ones that didn’t worked I found that the following is the cause of the error.

<item>
    <description>
        <![CDATA[This is a description for a test [...]]]>
    </description>
</item>

Because that in this description tag I have a closing bracket followed by the closing brackets of the CDATA is causing my error, I’ve made a code with C# using LINQ for the same XML and everything worked.

The closing bracket that is just before the closing brackets of CDATA is causing this strange behaviour. As a test I’ve tried to read the same XML using C# and LINQ, everything worked okay.

Then I tried to add a space between the closing brackets, like the following

<![CDATA[This is a description for a test [...] ]]>

And it worked!

my javascript code

function LoadRSS() {
    http_request.onreadystatechange = function () { showContent(http_request); };
    http_request.open("GET", "./feeds/test.xml", true);
    http_request.send(false);
}


function showContent(http_request) {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            var parser = new DOMParser();
            var xml_doc = parser.parseFromString(http_request.responseText, "text/xml");
            alert(xml_doc.firstChild)
        }
        else {
            xml_doc = null;
        }
    }
}

Does anyone have faced something similar? Now I really don’t know how to proceed any comments and suggestions are welcomed.

  • 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-05-19T03:40:16+00:00Added an answer on May 19, 2026 at 3:40 am

    Whatever browser you’re using seems to be parsing CDATA sections incorrectly — only ]]> marks the end of the section, any other square brackets should not affect this at all.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6

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.