Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-08-2007, 03:12 PM   #1
flexmee
Registered User
 
Join Date: Jan 2007
Posts: 37
Default How to get ![CDATA from xml

Do anyone now how to get CDATA from xml in as3?

example:
- <Data>
- <![CDATA[ 84,98 kB]]>
</Data>
flexmee is offline   Reply With Quote
Old 02-09-2007, 04:56 AM   #2
peteranselmo
Registered User
 
Join Date: Dec 2004
Location: New York
Posts: 64
Default

Code:
package
{
	
	public class Test {
		
	public function Test() 
	{
		trace('tracing xml');
		var _xmlData:XML = new XML('<Data><![CDATA[84,98 kB]]></Data>');
		trace(_xmlData);
	}
		
	}
}
for the most part the CDATA is ignored so you don't need anything special to read the content
peteranselmo is offline   Reply With Quote
Old 02-09-2007, 04:58 AM   #3
peteranselmo
Registered User
 
Join Date: Dec 2004
Location: New York
Posts: 64
Default

or if its nested..

Code:
package
{
	
	public class Test {
		
	public function Test() 
	{
		trace('tracing xml');
		var _xmlData:XML = new XML('<Data><node><![CDATA[84,98 kB]]></node></Data>');
		trace(_xmlData.node);
	}
		
	}
}
peteranselmo is offline   Reply With Quote
Old 02-09-2007, 05:01 AM   #4
peteranselmo
Registered User
 
Join Date: Dec 2004
Location: New York
Posts: 64
Default

sorry for the mutli post reply but thanks to e4x you can even do something like

Code:
package
{
	
	public class Test {
		
	public function Test() 
	{
		trace('tracing xml');
		var _xmlData:XML = new XML('<Data><node><innernode><innerinnernode><![CDATA[84,98 kB]]></innerinnernode></innernode></node></Data>');
		trace(_xmlData..innerinnernode);
	}
		
	}
}
i recommend the oreilly book.. (as always)
peteranselmo is offline   Reply With Quote
Old 02-09-2007, 12:41 PM   #5
flexmee
Registered User
 
Join Date: Jan 2007
Posts: 37
Default

Thanks for yout reply!

Now it works!
flexmee is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
load multiple xml files whatthecrap ActionScript 2.0 6 05-01-2008 09:43 PM
XMLSpy images & xml file amervb ActionScript 2.0 3 02-08-2007 06:54 PM
Total nodes of XML mikkeX ActionScript 2.0 2 02-07-2007 05:41 PM
Load XML content into a textarea when rolling over a flash menu Andrew12357 ActionScript 1.0 (and below) 0 02-04-2007 01:00 AM
XML node values Digeart ActionScript 2.0 1 02-02-2007 03:55 AM


All times are GMT. The time now is 11:55 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.