oliviaramos / simile-widgets

Automatically exported from code.google.com/p/simile-widgets
0 stars 0 forks source link

CDATA in event XML #342

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Forgive me if this has been reported, but I searched and didn't see it.

I am not sure if Timeline.DefaultEventSource.prototype.loadXML() is
properly handling CDATA in an event.  Right now the code is checking to see
if the nodeType is 3, which is a TEXT_NODE.  I think at the least, this
should be changed to check for 3 or 4 (TEXT_NODE or CDATA_SECTION_NODE).

There is a larger issue of allowing text, CDATA, and comments inside an
event element.  I think the best way to handle this is check to see if
node.firstChild is not null, and then loop through the child nodes and
build up the description string from any children that are TEXT_NODE or
CDATA_SECTION_NODE.

I will likely patch my local copy if a diff is desired.

Original issue reported on code.google.com by mattd%wh...@gtempaccount.com on 15 Dec 2009 at 9:57

GoogleCodeExporter commented 8 years ago
Patch is attached, if desired.

Original comment by mattd%wh...@gtempaccount.com on 16 Dec 2009 at 3:37

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by ryan...@csail.mit.edu on 23 Jun 2011 at 10:26

GoogleCodeExporter commented 8 years ago
Thank you so much, this was saving me alot of time, that I had not to search 
myself for the point in the sourcecode where the rendering was reading from xml!

I wanted to use CDATA_SECTION_NODE, too, because it makes so much sense for my 
project, that no special characters from a text causes my xml to be invalid. It 
is so much simpler for me to use CDATA.

It is working great and now I switched to api v2.3 with local js-source-files.

Original comment by FritzBox...@gmail.com on 9 Jul 2011 at 7:43