all groups > flash data integration > june 2007 >
You're in the

flash data integration

group:

Parsing CDATA


Parsing CDATA Keltaz
6/19/2007 8:20:09 PM
flash data integration:
Am I missing something simple? The research I've done all say that reading
cdata from an xml in flash is easy, so they don't explain how. Here's my
problem. Node looks like this:

<DDATE>
<#cdata-section>2007-06-19 14:38:58.0</#cdata-section>
</DDATE>

but when I try to convert it to a string (mystring=xml.node.DDATE) I get the
above (which I'm going to go ahead and parse today for what I need). If I try
to parse xml.node.DDATE.child, .firstChild, or .text all I get is empty string
"". I can't try xml.node.DDATE.#cdata-section because that creates a compiler
error

Any thoughts?

Thanks.
Re: Parsing CDATA Raymond Basque
6/20/2007 12:00:00 AM
First, where does this "<#cdata-section>" syntax come from?

The proper way to markup a CDATA section is <![CDATA[]]>. See
http://www.w3.org/TR/2000/REC-xml-20001006#sec-cdata-sect

Using your example:

var xml:XML = new XML("<DDATE><![CDATA[2007-06-19 14:38:58.0]]></DDATE>");
trace(xml.firstChild.firstChild.nodeValue)



AddThis Social Bookmark Button