<?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"
	>
<channel>
	<title>Comments on: Using E4X with XML in AS3</title>
	<atom:link href="http://keith-hair.net/blog/2008/05/31/using-e4x-with-xml-in-as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://keith-hair.net/blog/2008/05/31/using-e4x-with-xml-in-as3/</link>
	<description>Scripting is fun like any other hobby</description>
	<pubDate>Wed, 07 Jan 2009 14:21:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Calvin</title>
		<link>http://keith-hair.net/blog/2008/05/31/using-e4x-with-xml-in-as3/#comment-148</link>
		<dc:creator>Calvin</dc:creator>
		<pubDate>Sat, 22 Nov 2008 09:00:54 +0000</pubDate>
		<guid isPermaLink="false">http://keith-hair.com/blog/?p=5#comment-148</guid>
		<description>Yeah it doesn't really seem too logical does it? Just think that I must be missing some trick here, but there you go!

I think typeof will return 'XML' no matter if it's XML or XMLList every time - you know like typeof on an Array is always 'object', but it is interesting that using 'is' gives false for is XML, true for is XMLList - yet you can delete (i.e. no error #1119) when the XMLList wasn't made using a filter. Really weird.

Ah well, looping it is! For now...</description>
		<content:encoded><![CDATA[<p>Yeah it doesn&#8217;t really seem too logical does it? Just think that I must be missing some trick here, but there you go!</p>
<p>I think typeof will return &#8216;XML&#8217; no matter if it&#8217;s XML or XMLList every time - you know like typeof on an Array is always &#8216;object&#8217;, but it is interesting that using &#8216;is&#8217; gives false for is XML, true for is XMLList - yet you can delete (i.e. no error #1119) when the XMLList wasn&#8217;t made using a filter. Really weird.</p>
<p>Ah well, looping it is! For now&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith H</title>
		<link>http://keith-hair.net/blog/2008/05/31/using-e4x-with-xml-in-as3/#comment-147</link>
		<dc:creator>Keith H</dc:creator>
		<pubDate>Sat, 22 Nov 2008 01:10:26 +0000</pubDate>
		<guid isPermaLink="false">http://keith-hair.com/blog/?p=5#comment-147</guid>
		<description>I'd like more info on it too.

I think it's safe to say you can't delete an E4X expression operator "()", but you can delete an XML node of it.
and all of the nodes nested in that node....by using [index] bracket operator on it

Yep its strange. The return datatype of this syntax "doc..*.worm"  is an XMLList.

doc..*.worm  //technically this is XMLList but delete works when the E4X syntax DOES NOT have an expression.
doc..*.(name()=="worm") //The return type is XMLList and delete does not work with XMLList.
doc..*.(name()=="worm")[0] //The return type is XML and delete works for XML.

The "Expression" part of E4X syntax always returns an XMLList.
The delete operator does not work with XMLList.
delete doc..*.(name()=="worm");//TypeError: Error #1119: Delete operator is not supported

More strange confusion when I test:

trace("Testing 'typeof'");
trace(typeof doc..*.worm); //says its XML an not XMLList
trace(typeof doc..*.(name()=="worm")); //also says its XML an not XMLList
trace("");
trace("Testing 'is'");
trace(doc..*.worm is XML);
trace(doc..*.(name()=="worm") is XML);
trace("");</description>
		<content:encoded><![CDATA[<p>I&#8217;d like more info on it too.</p>
<p>I think it&#8217;s safe to say you can&#8217;t delete an E4X expression operator &#8220;()&#8221;, but you can delete an XML node of it.<br />
and all of the nodes nested in that node&#8230;.by using [index] bracket operator on it</p>
<p>Yep its strange. The return datatype of this syntax &#8220;doc..*.worm&#8221;  is an XMLList.</p>
<p>doc..*.worm  //technically this is XMLList but delete works when the E4X syntax DOES NOT have an expression.<br />
doc..*.(name()==&#8221;worm&#8221;) //The return type is XMLList and delete does not work with XMLList.<br />
doc..*.(name()==&#8221;worm&#8221;)[0] //The return type is XML and delete works for XML.</p>
<p>The &#8220;Expression&#8221; part of E4X syntax always returns an XMLList.<br />
The delete operator does not work with XMLList.<br />
delete doc..*.(name()==&#8221;worm&#8221;);//TypeError: Error #1119: Delete operator is not supported</p>
<p>More strange confusion when I test:</p>
<p>trace(&#8221;Testing &#8216;typeof&#8217;&#8221;);<br />
trace(typeof doc..*.worm); //says its XML an not XMLList<br />
trace(typeof doc..*.(name()==&#8221;worm&#8221;)); //also says its XML an not XMLList<br />
trace(&#8221;");<br />
trace(&#8221;Testing &#8216;is&#8217;&#8221;);<br />
trace(doc..*.worm is XML);<br />
trace(doc..*.(name()==&#8221;worm&#8221;) is XML);<br />
trace(&#8221;");</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Calvin</title>
		<link>http://keith-hair.net/blog/2008/05/31/using-e4x-with-xml-in-as3/#comment-146</link>
		<dc:creator>Calvin</dc:creator>
		<pubDate>Fri, 21 Nov 2008 22:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://keith-hair.com/blog/?p=5#comment-146</guid>
		<description>re: delete doc..*.worm;

So if the worm nodes had another attribute - say type, with 'good' or 'evil', and say 2 were 'evil' - how would you filter the xml to delete just the evil 2?

You would think:
delete doc..*.worm.(@type=="evil");
but you get the error "Delete operator is not supported with operand of type XMLList" - strange as you'd assume doc..*.worm is returning an XMLList too...

You can go
doc..*.worm.(@type=="evil")[0];
which would delete one of them (and naturally [1] to delete the other - but clearly not helpful) - so does that mean looping over the XMLList is the only way to delete multiple nodes based on a filter criteria? Be a bit of a shame if that is the case - hopefully you can tell me I'm missing something obvious??</description>
		<content:encoded><![CDATA[<p>re: delete doc..*.worm;</p>
<p>So if the worm nodes had another attribute - say type, with &#8216;good&#8217; or &#8216;evil&#8217;, and say 2 were &#8216;evil&#8217; - how would you filter the xml to delete just the evil 2?</p>
<p>You would think:<br />
delete doc..*.worm.(@type==&#8221;evil&#8221;);<br />
but you get the error &#8220;Delete operator is not supported with operand of type XMLList&#8221; - strange as you&#8217;d assume doc..*.worm is returning an XMLList too&#8230;</p>
<p>You can go<br />
doc..*.worm.(@type==&#8221;evil&#8221;)[0];<br />
which would delete one of them (and naturally [1] to delete the other - but clearly not helpful) - so does that mean looping over the XMLList is the only way to delete multiple nodes based on a filter criteria? Be a bit of a shame if that is the case - hopefully you can tell me I&#8217;m missing something obvious??</p>
]]></content:encoded>
	</item>
</channel>
</rss>
