If you're wanting to turn the CDATA into XML, I did a quick search for you
which resulted in this link which might be handy...
http://www.actionscript.org/forums/showthread.php3?t=196374
The top of the thread may be good for you too.
Google Voice: (508) 656-0622
Twitter: eric_dolecki
If you are getting ![CDATA[ values from using e4x you have html encoded
tags. like this: l t ; and $ g t; Open the xml file with notepad and
you will see. The text in CDATA should act as a normal text node.
HTH/Christoffer
Mendelsohn, Michael skrev 2011-06-20 16:35:
Hi list...
I've searched
CDATA is just an encoding trick to force the parser to not parse the
data as containing tags.
It represents plain old text so treat it like plain old text.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
The cdata tags shouldn't be included in the read data. CDATA tags are part
of the xml standard and are only used to wrap tags that could break the XML
format - making the content safer, but without changing the content.
This:
nodeTest/node
Should read the same as this:
node![CDATA[Test]]/node
Well, how about that!
var kids = xmlData.children();
// gets me the CDATA content without the ![CDATA[ or ]]
var kidscdata:String = kids[0].toString();
I was doing this RegExp, which also worked, but isn't necessary:
var altered:String = kidscdata.replace(new
RegExp((^\!\[CDATA\[)(.+)(\]\]\),
Subject: RE: [Flashcoders] E4X: reading CDATA
Well, how about that!
var kids = xmlData.children();
// gets me the CDATA content without the ![CDATA[ or ]] var kidscdata:String
= kids[0].toString();
I was doing this RegExp, which also worked, but isn't necessary:
var altered:String = kidscdata.replace
Merrill, Jason skriver:
var kids = xmlData.children(); // gets me the CDATA content without the![CDATA[
or ]]
var kidscdata:String = kids[0].toString();
That seems unnecessary unless I don't understand your question. Wouldn't var
kids:String = theXMLNode.text() work?
The text method
Zeh, et al: sometimes, it just takes what I refer to as a blinding glimpse of
the obvious to come up with concise solutions.
:-)
- MM
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Henrik Andersson
Sent: Monday, June 20, 2011 11:21 AM
To: Flash Coders List
Subject: Re: [Flashcoders] E4X: reading CDATA
Merrill, Jason skriver:
var kids = xmlData.children
Jason, couldn't have said it better myself. The RegExp was unnecessary, but at
least it worked. The toString() method did fine for my purposes. :-)
- MM
like going out the front door of a house, walking around to the back and then
going in the back door just to get to the kitchen.
] On Behalf Of Mendelsohn,
Michael
Sent: Monday, June 20, 2011 12:39 PM
To: Flash Coders List
Subject: RE: [Flashcoders] E4X: reading CDATA
Jason, couldn't have said it better myself. The RegExp was unnecessary, but at
least it worked. The toString() method did fine for my purposes. :-)
- MM
like
Sure...the reason is that in all the xml files I'm pulling in, I know the
structure, it's the same for all. There's only one item tag in each xml
file. So, I don't need an xmllist, given that there's only one item, I can
just call toString(). But, I see where you're coming from with an
...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Mendelsohn,
Michael
Sent: Monday, June 20, 2011 12:57 PM
To: Flash Coders List
Subject: RE: [Flashcoders] E4X: reading CDATA
Sure...the reason is that in all the xml files I'm pulling in, I know the
structure, it's
13 matches
Mail list logo