<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Deleting Nodes Recursively from XML Structures</title>
	<atom:link href="http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/</link>
	<description>flex developers web corner</description>
	<lastBuildDate>Wed, 18 Jan 2012 13:28:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Chintan Bagdawala</title>
		<link>http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/comment-page-1/#comment-1984</link>
		<dc:creator>Chintan Bagdawala</dc:creator>
		<pubDate>Thu, 04 Nov 2010 09:08:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/#comment-1984</guid>
		<description>Thanks a lot friend....</description>
		<content:encoded><![CDATA[<p>Thanks a lot friend&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrei Ionescu</title>
		<link>http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/comment-page-1/#comment-1869</link>
		<dc:creator>Andrei Ionescu</dc:creator>
		<pubDate>Thu, 22 Apr 2010 08:34:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/#comment-1869</guid>
		<description>Kara, thank you for your comment. You&#039;re right. I implemented the changes in the article.</description>
		<content:encoded><![CDATA[<p>Kara, thank you for your comment. You&#8217;re right. I implemented the changes in the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kara</title>
		<link>http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/comment-page-1/#comment-1868</link>
		<dc:creator>Kara</dc:creator>
		<pubDate>Wed, 21 Apr 2010 21:05:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/#comment-1868</guid>
		<description>Thanks for posting this.  I just found one error when trying to use it... You need to access the nodes in xml, not xml.children initially.  You will check the child nodes during recursion (the way it was before, every other level of the tree was being skipped completely). I have posted the corrected version below.
&lt;pre lang=&quot;actionscript&quot;&gt;public function goThrough(xml:XMLList, removeData:Array):void
{
    if (xml.length() &gt; 0)
    {
        for (var i:int = xml.length() - 1; i &gt;= 0 ; i--)
        {
            if (removeData.indexOf(xml[i].@id_data.toString()) != -1)
            {
                debugText.text += xml[i].@id_data + &quot;\n&quot;;
                delete xml[i];
            } else {
                if (xml[i].children())
                {
                    goThrough(xml[i].children(),removeData);
                }
            }
        }
    }
}&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Thanks for posting this.  I just found one error when trying to use it&#8230; You need to access the nodes in xml, not xml.children initially.  You will check the child nodes during recursion (the way it was before, every other level of the tree was being skipped completely). I have posted the corrected version below.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> goThrough<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">xml</span>:XMLList, removeData:<span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">xml</span>.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #0066CC;">xml</span>.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> - <span style="color: #cc66cc;">1</span>; i <span style="color: #66cc66;">&gt;</span>= <span style="color: #cc66cc;">0</span> ; i--<span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>removeData.<span style="color: #0066CC;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">xml</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #66cc66;">@</span>id_data.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">!</span>= -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
            <span style="color: #66cc66;">&#123;</span>
                debugText.<span style="color: #0066CC;">text</span> += <span style="color: #0066CC;">xml</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #66cc66;">@</span>id_data + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
                <span style="color: #0066CC;">delete</span> <span style="color: #0066CC;">xml</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>;
            <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">xml</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">children</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    goThrough<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">xml</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">children</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>,removeData<span style="color: #66cc66;">&#41;</span>;
                <span style="color: #66cc66;">&#125;</span>
            <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/comment-page-1/#comment-1723</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Fri, 09 Oct 2009 13:37:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/#comment-1723</guid>
		<description>Thank you, this is great.</description>
		<content:encoded><![CDATA[<p>Thank you, this is great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrei Ionescu</title>
		<link>http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/comment-page-1/#comment-1449</link>
		<dc:creator>Andrei Ionescu</dc:creator>
		<pubDate>Wed, 25 Feb 2009 14:04:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/#comment-1449</guid>
		<description>Cengiz, thanks for the comment. You&#039;re right if you tried to delete to consecutive nodes in the same parent it won&#039;t work.

Instead of decreasing the &quot;&lt;strong&gt;i&lt;/strong&gt;&quot; variable, as you proposed, I&#039;m looping from the last node to the first.

Now it should work.</description>
		<content:encoded><![CDATA[<p>Cengiz, thanks for the comment. You&#8217;re right if you tried to delete to consecutive nodes in the same parent it won&#8217;t work.</p>
<p>Instead of decreasing the &#8220;<strong>i</strong>&#8221; variable, as you proposed, I&#8217;m looping from the last node to the first.</p>
<p>Now it should work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cengiz Can</title>
		<link>http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/comment-page-1/#comment-1448</link>
		<dc:creator>Cengiz Can</dc:creator>
		<pubDate>Wed, 25 Feb 2009 13:02:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/#comment-1448</guid>
		<description>Good work, thanks! But fails while deleting following nodes. Needs to decrement index (i&#45;&#45;) after deleting the node.</description>
		<content:encoded><![CDATA[<p>Good work, thanks! But fails while deleting following nodes. Needs to decrement index (i&#45;&#45;) after deleting the node.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mandy</title>
		<link>http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/comment-page-1/#comment-1186</link>
		<dc:creator>Mandy</dc:creator>
		<pubDate>Sat, 07 Feb 2009 02:23:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/#comment-1186</guid>
		<description>Hey guys, may I know how to create a XMLList while Im using  to get dynamic data? I need to refresh my data grid which get data dynamically from a php page.</description>
		<content:encoded><![CDATA[<p>Hey guys, may I know how to create a XMLList while Im using  to get dynamic data? I need to refresh my data grid which get data dynamically from a php page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrei Ionescu</title>
		<link>http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/comment-page-1/#comment-708</link>
		<dc:creator>Andrei Ionescu</dc:creator>
		<pubDate>Thu, 04 Sep 2008 07:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/#comment-708</guid>
		<description>Thank you Aaron!</description>
		<content:encoded><![CDATA[<p>Thank you Aaron!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Nance</title>
		<link>http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/comment-page-1/#comment-706</link>
		<dc:creator>Aaron Nance</dc:creator>
		<pubDate>Wed, 03 Sep 2008 22:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/#comment-706</guid>
		<description>AS3 does have a very poorly documented &quot;delete&quot; function that you can use to delete a node and all its children.  You can see an example I posted on &lt;a href=&quot;http://www.kirupa.com/forum/showthread.php?p=2382229#post2382229&quot; rel=&quot;nofollow&quot;&gt;Kirupa&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>AS3 does have a very poorly documented &#8220;delete&#8221; function that you can use to delete a node and all its children.  You can see an example I posted on <a target="_blank" href="http://www.kirupa.com/forum/showthread.php?p=2382229#post2382229" rel="nofollow">Kirupa</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maikel Sibbald</title>
		<link>http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/comment-page-1/#comment-35</link>
		<dc:creator>Maikel Sibbald</dc:creator>
		<pubDate>Wed, 06 Feb 2008 10:24:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/2008/01/29/deleting-nodes-recursively-from-xml-structures/#comment-35</guid>
		<description>He great stuff, here something simular but with an arraycollection. 

http://labs.flexcoders.nl/2007/03/29/flex-treecontrol-search-sample/</description>
		<content:encoded><![CDATA[<p>He great stuff, here something simular but with an arraycollection. </p>
<p><a href="http://labs.flexcoders.nl/2007/03/29/flex-treecontrol-search-sample/" rel="nofollow">http://labs.flexcoders.nl/2007/03/29/flex-treecontrol-search-sample/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

