dbankier / XMLTools-For-Appcelerator-Titanium

MIT License
64 stars 12 forks source link

Rss problem #4

Closed mezhevikin closed 11 years ago

mezhevikin commented 11 years ago

Use XMLTools for parsing RSS. Everything is working fine, but feed (http://habrahabr.ru/rss/best/) returns:

{
      channel = "\n\t";
      version = "2.0";
}

In what may be problem? xml valid.

var url = 'http://habrahabr.ru/rss/best/';        
var client = Ti.Network.createHTTPClient();
client.open("GET", url, false);
client.send();

var XMLTools = require("XMLTools");
var xml = new XMLTools(client.responseText);
var my_object = xml.toObject();
Ti.API.info(my_object);
mezhevikin commented 11 years ago

I think the problem is due to <![CDATA[ ]] in tags

dbankier commented 11 years ago

The issue wasn't with the CDATA (even though it wasn't supported). It was with the Titanium XML parser interpreting "\n\t" as textContent. Have fixed it and added CDATA support. Should be good now.

mezhevikin commented 11 years ago

Cool :)