<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Accessing text in XML with Flash ActionScript - Why is it so hard?</title><link>http://weblogs.asp.net/twalters/pages/10141.aspx</link><description>Text content in XML One of the more frequently asked questions regarding XML in Flash is related to the text content of XML nodes. Consider the following XML: [xml] &amp;lt;people&amp;gt; &amp;lt;person&amp;gt; &amp;lt;givenName&amp;gt;Timothy&amp;lt;/givenName&amp;gt; &amp;lt;initial&amp;gt;J&amp;lt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Accessing text in XML with Flash ActionScript - Why is it so hard?</title><link>http://weblogs.asp.net/twalters/pages/10141.aspx#7236352</link><pubDate>Thu, 22 Oct 2009 21:17:52 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7236352</guid><dc:creator>JXL93</dc:creator><author>JXL93</author><description>&lt;p&gt;The result for the crust on this chicken is a slightly nuttier and more rustic flavor. , &lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7236352" width="1" height="1"&gt;</description></item><item><title>re: Accessing text in XML with Flash ActionScript - Why is it so hard?</title><link>http://weblogs.asp.net/twalters/pages/10141.aspx#6486638</link><pubDate>Tue, 05 Aug 2008 16:31:54 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6486638</guid><dc:creator>Lama</dc:creator><author>Lama</author><description>&lt;p&gt;Me helped it mouch, i have updated your code, becouse i needed to read nodeValue and write it in htmlText field with tags.&lt;/p&gt;
&lt;p&gt;XMLNode.prototype.innerText = function() {&lt;/p&gt;
&lt;p&gt;	var strText = &amp;quot;&amp;quot;;&lt;/p&gt;
&lt;p&gt;	var xmlNode;&lt;/p&gt;
&lt;p&gt;	for (var i = 0; i&amp;lt;this.childNodes.length; i++) {&lt;/p&gt;
&lt;p&gt;		xmlNode = this.childNodes[i];&lt;/p&gt;
&lt;p&gt;		if (xmlNode.nodeName) {&lt;/p&gt;
&lt;p&gt;			strText += &amp;quot;&amp;lt;&amp;quot;+xmlNode.nodeName;&lt;/p&gt;
&lt;p&gt;			for (attr in xmlNode.attributes) {&lt;/p&gt;
&lt;p&gt;				strText += &amp;quot; &amp;quot;+attr+&amp;quot; = '&amp;quot;+xmlNode.attributes[attr]+&amp;quot;'&amp;quot;;&lt;/p&gt;
&lt;p&gt;			}&lt;/p&gt;
&lt;p&gt;			strText += &amp;quot; &amp;gt;&amp;quot;;&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt;		// &amp;nbsp;&lt;/p&gt;
&lt;p&gt;		switch (xmlNode.nodeType) {&lt;/p&gt;
&lt;p&gt;			case 1 :// elements&lt;/p&gt;
&lt;p&gt;				strText += xmlNode.innerText();&lt;/p&gt;
&lt;p&gt;				break;&lt;/p&gt;
&lt;p&gt;			case 3 :// text&lt;/p&gt;
&lt;p&gt;				strText += xmlNode.nodeValue;&lt;/p&gt;
&lt;p&gt;				break;&lt;/p&gt;
&lt;p&gt;			default :// comments etc&lt;/p&gt;
&lt;p&gt;				break;&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt;		//&lt;/p&gt;
&lt;p&gt;		if (xmlNode.nodeName) {&lt;/p&gt;
&lt;p&gt;			strText += &amp;quot;&amp;lt;/&amp;quot;+xmlNode.nodeName+&amp;quot;&amp;gt;&amp;quot;;&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt;	}&lt;/p&gt;
&lt;p&gt;	return strText;&lt;/p&gt;
&lt;p&gt;};&lt;/p&gt;
&lt;p&gt;thanx&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6486638" width="1" height="1"&gt;</description></item><item><title>re: Accessing text in XML with Flash ActionScript - Why is it so hard?</title><link>http://weblogs.asp.net/twalters/pages/10141.aspx#6411619</link><pubDate>Thu, 17 Jul 2008 16:21:57 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6411619</guid><dc:creator>Justus</dc:creator><author>Justus</author><description>&lt;p&gt;Thank you. Fixed my bug.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6411619" width="1" height="1"&gt;</description></item><item><title>re: Accessing text in XML with Flash ActionScript - Why is it so hard?</title><link>http://weblogs.asp.net/twalters/pages/10141.aspx#6094862</link><pubDate>Sun, 13 Apr 2008 23:34:13 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6094862</guid><dc:creator>Hamish</dc:creator><author>Hamish</author><description>&lt;p&gt;Thanks so much, this helped me heaps!!!!&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6094862" width="1" height="1"&gt;</description></item><item><title>re: Accessing text in XML with Flash ActionScript - Why is it so hard?</title><link>http://weblogs.asp.net/twalters/pages/10141.aspx#3268220</link><pubDate>Tue, 24 Jul 2007 19:54:47 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:3268220</guid><dc:creator>Michael Weber</dc:creator><author>Michael Weber</author><description>&lt;p&gt;I would have never tried node.childNode.nodeValue if I hadn't found this site - thank you!&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=3268220" width="1" height="1"&gt;</description></item><item><title>re: Accessing text in XML with Flash ActionScript - Why is it so hard?</title><link>http://weblogs.asp.net/twalters/pages/10141.aspx#2980342</link><pubDate>Sat, 30 Jun 2007 00:35:34 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:2980342</guid><dc:creator>Christian M. Cepel</dc:creator><author>Christian M. Cepel</author><description>&lt;p&gt;Thank you. &amp;nbsp; You ended hours of frustration for me.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2980342" width="1" height="1"&gt;</description></item><item><title>re: Accessing text in XML with Flash ActionScript - Why is it so hard?</title><link>http://weblogs.asp.net/twalters/pages/10141.aspx#77318</link><pubDate>Fri, 20 Feb 2004 21:12:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:77318</guid><dc:creator>TAZ</dc:creator><author>TAZ</author><description>+++++WEB+++++&lt;br&gt;Longhorn flash mx pro&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=77318" width="1" height="1"&gt;</description></item><item><title>A year already?! Where do I go from here...</title><link>http://weblogs.asp.net/twalters/pages/10141.aspx#76595</link><pubDate>Thu, 19 Feb 2004 08:35:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:76595</guid><dc:creator>TrackBack</dc:creator><author>TrackBack</author><description>&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=76595" width="1" height="1"&gt;</description></item><item><title>re: Accessing text in XML with Flash ActionScript - Why is it so hard?</title><link>http://weblogs.asp.net/twalters/pages/10141.aspx#73761</link><pubDate>Mon, 16 Feb 2004 14:05:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:73761</guid><dc:creator>Ruhre</dc:creator><author>Ruhre</author><description>XML in Flash is being like going to dentist for me, with its confusing syntax. This document helped me on a &amp;quot;childNodes[n].nodeValue&amp;quot; issue. Thanks.&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=73761" width="1" height="1"&gt;</description></item><item><title>re: Accessing text in XML with Flash ActionScript - Why is it so hard?</title><link>http://weblogs.asp.net/twalters/pages/10141.aspx#69086</link><pubDate>Sat, 07 Feb 2004 02:52:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:69086</guid><dc:creator>andreas</dc:creator><author>andreas</author><description>good stuff. helped me finally to get my head around how flash deals with xml. thanks a lot...&lt;br&gt;&lt;br&gt;...andreas...&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=69086" width="1" height="1"&gt;</description></item></channel></rss>