[ 1 post ] 
Author Message
 Post subject: Empty CDATA fields cause the xml dom parser to fail
PostPosted: Sat Apr 24, 2010 8:05 am 
User avatar

Joined: Sat Aug 01, 2009 6:23 pm
Posts: 10
It seems that empty CDATA fields cause the xml dom parser to throw an exception.
Code:
<root>
<title><![CDATA[]]></title>
</root>

The following lines work when run by Safari with title getting an empty string. When run thru the webOS dom parser the second line throws an exception.

Code:
var xml = transport.responseXML.getElementsByTagName("root");
var title = xml[0].getElementsByTagName("title")[0].firstChild.data;

_________________
Ampache Mobile


Top
 Profile  
 
Display posts from previous:  Sort by  
   [ 1 post ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron