<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>creacog &#187; E4X</title>
	<atom:link href="http://blog.creacog.co.uk/category/e4x/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.creacog.co.uk</link>
	<description></description>
	<lastBuildDate>Thu, 19 Jan 2012 16:43:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>E4X delete&#8230; not so obvious&#8230; but easy</title>
		<link>http://blog.creacog.co.uk/2008/03/31/e4x-delete-not-so-obvious-but-easy/</link>
		<comments>http://blog.creacog.co.uk/2008/03/31/e4x-delete-not-so-obvious-but-easy/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 14:24:53 +0000</pubDate>
		<dc:creator>creacog</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[E4X]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.creacog.co.uk/2008/03/31/e4x-delete-not-so-obvious-but-easy/</guid>
		<description><![CDATA[I&#8217;ve just been trying to delete a node and all its descendants from an XML object selected on the value of an attribute. Having read the &#8220;ECMAScript for XML (E4X) Specification&#8221; (PDF) as linked to from the Flex documentation I expected to be able to write the following&#8230; delete theXMLObject..*.(@id=="theIDtoDelete"); however the above code will [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just been trying to delete a node and all its descendants from an XML object selected  on the value of an  attribute. Having read the  &#8220;<a href="http://www.ecma-international.org/publications/standards/Ecma-357.htm" title="ECMAScript for XML (E4X) Specification">ECMAScript for XML (E4X) Specification</a>&#8221; (PDF) as linked to from the Flex documentation I expected to be able to write the following&#8230;</p>
<p><code>delete theXMLObject..*.(@id=="theIDtoDelete");</code></p>
<p>however the above code will generate the following Flash  Player runtime error&#8230;</p>
<p>TypeError: Error #1119: Delete operator is not supported with operand of type XMLList</p>
<p>The solution is simple if not obvious. The above code should be rewritten to ensure a single node is returned rather than a list&#8230;</p>
<p><code>delete theXMLObject..*.(@id=="theIDtoDelete")[0];</code></p>
<p>Distilled from this <a href="http://www.actionscript.org/forums/showthread.php3?t=143616" title="Deleting XML Element">actionscript.org thread</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.creacog.co.uk/2008/03/31/e4x-delete-not-so-obvious-but-easy/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

