<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
	>
<channel>
	<title>Comments on: Using E4X With XHTML? Watch Your Namespaces!</title>
	<atom:link href="http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/feed/" rel="self" type="application/rss+xml" />
	<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/</link>
	<description>Collective thoughts of the New York Flash community</description>
	<lastBuildDate>Wed, 24 Jun 2009 22:08:49 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: links for 2009-01-22 &#171; Jeffrey Isham</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-135848</link>
		<dc:creator>links for 2009-01-22 &#171; Jeffrey Isham</dc:creator>
		<pubDate>Fri, 23 Jan 2009 00:01:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-135848</guid>
		<description>[...] dispatchEvent()™ » Blog Archive » Using E4X With XHTML? Watch Your Namespaces! (tags: actionscript) [...]</description>
		<content:encoded><![CDATA[<p>[...] dispatchEvent()™ » Blog Archive » Using E4X With XHTML? Watch Your Namespaces! (tags: actionscript) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek Basch</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-135778</link>
		<dc:creator>Derek Basch</dc:creator>
		<pubDate>Thu, 22 Jan 2009 07:25:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-135778</guid>
		<description>Thanks,

This was invaluable. I was stuck on this for hours.</description>
		<content:encoded><![CDATA[<p>Thanks,</p>
<p>This was invaluable. I was stuck on this for hours.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Monokai &#187; Blog Archive &#187; Flash SEO: graceful degradation to add meaning and structure</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-128955</link>
		<dc:creator>Monokai &#187; Blog Archive &#187; Flash SEO: graceful degradation to add meaning and structure</dc:creator>
		<pubDate>Mon, 20 Oct 2008 08:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-128955</guid>
		<description>[...] Actionscript 3 E4X rundown Using E4X with XHTML? Watch your namespaces! [...]</description>
		<content:encoded><![CDATA[<p>[...] Actionscript 3 E4X rundown Using E4X with XHTML? Watch your namespaces! [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philip Bulley</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-99598</link>
		<dc:creator>Philip Bulley</dc:creator>
		<pubDate>Wed, 02 Apr 2008 16:33:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-99598</guid>
		<description>Great post... figured I had a namespace issue, but had no idea of how to reference it! Thanks mate.</description>
		<content:encoded><![CDATA[<p>Great post&#8230; figured I had a namespace issue, but had no idea of how to reference it! Thanks mate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mitch</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-18140</link>
		<dc:creator>Mitch</dc:creator>
		<pubDate>Tue, 17 Jul 2007 12:27:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-18140</guid>
		<description>This is invaluable. Thank you for publishing this.</description>
		<content:encoded><![CDATA[<p>This is invaluable. Thank you for publishing this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-16246</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Thu, 05 Jul 2007 14:52:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-16246</guid>
		<description>Don&#039;t forget:
if (myXhtmlDocument.namespace(&quot;&quot;) != undefined){
    default xml namespace = myXhtmlDocument.namespace(&quot;&quot;);
}

If your xml has a default namespace it&#039;ll set it as your default, so your calls won&#039;t need the namespace prepended</description>
		<content:encoded><![CDATA[<p>Don&#8217;t forget:<br />
if (myXhtmlDocument.namespace(&#8221;") != undefined){<br />
    default xml namespace = myXhtmlDocument.namespace(&#8221;");<br />
}</p>
<p>If your xml has a default namespace it&#8217;ll set it as your default, so your calls won&#8217;t need the namespace prepended</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dispatchEvent &#187; AS3 E4X Rundown</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-7402</link>
		<dc:creator>dispatchEvent &#187; AS3 E4X Rundown</dc:creator>
		<pubDate>Tue, 22 May 2007 01:07:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-7402</guid>
		<description>[...] I can write more about namespaces in a future revision, but for now check out the good discussion started in my previous post, Using E4X? Watch Your Namespaces. [...]</description>
		<content:encoded><![CDATA[<p>[...] I can write more about namespaces in a future revision, but for now check out the good discussion started in my previous post, Using E4X? Watch Your Namespaces. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Hall</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-1568</link>
		<dc:creator>Peter Hall</dc:creator>
		<pubDate>Wed, 28 Mar 2007 11:50:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-1568</guid>
		<description>It&#039;s not really that toXMLString() is limited. e4x works on a canonicalised data model. There are several ways to achieve the same XML object from different source strings - using default vs explicit namespaces is just one example. Canonicalisation makes XML simpler to work with, at the expense of losing how it was originally declared.</description>
		<content:encoded><![CDATA[<p>It&#8217;s not really that toXMLString() is limited. e4x works on a canonicalised data model. There are several ways to achieve the same XML object from different source strings &#8211; using default vs explicit namespaces is just one example. Canonicalisation makes XML simpler to work with, at the expense of losing how it was originally declared.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Braunstein</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-1344</link>
		<dc:creator>Roger Braunstein</dc:creator>
		<pubDate>Fri, 23 Mar 2007 00:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-1344</guid>
		<description>No, thank you for making things more interesting! Not to mention, I learned something about XML-ID!
I also think it&#039;s weird that just because the node exists in a namespace, it&#039;s not considered as declaring that namespace...</description>
		<content:encoded><![CDATA[<p>No, thank you for making things more interesting! Not to mention, I learned something about XML-ID!<br />
I also think it&#8217;s weird that just because the node exists in a namespace, it&#8217;s not considered as declaring that namespace&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Claus Wahlers</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-1343</link>
		<dc:creator>Claus Wahlers</dc:creator>
		<pubDate>Fri, 23 Mar 2007 00:09:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-1343</guid>
		<description>Yeah something like that, i don&#039;t know. What worries me more though is the buggy (?) behavior of namespaceDeclarations() in that case.

Sorry btw for hijacking your post ;)</description>
		<content:encoded><![CDATA[<p>Yeah something like that, i don&#8217;t know. What worries me more though is the buggy (?) behavior of namespaceDeclarations() in that case.</p>
<p>Sorry btw for hijacking your post ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Braunstein</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-1342</link>
		<dc:creator>Roger Braunstein</dc:creator>
		<pubDate>Thu, 22 Mar 2007 23:25:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-1342</guid>
		<description>It seems like a limitation that &lt;tt&gt;toXmlString()&lt;/tt&gt; can&#039;t handle default namespaces or implicitly defined namespaces. For instance, when you use &lt;tt&gt;xml:id&lt;/tt&gt;, you&#039;re using a namespace &lt;tt&gt;xml&lt;/tt&gt; that you don&#039;t declare, and when you&#039;re using the default namespace &lt;tt&gt;http://example.com&lt;/tt&gt; that namespace doesn&#039;t have a binding. &lt;tt&gt;toXmlString()&lt;/tt&gt; apparently wants everything to be explicit, so it makes up bindings for the two namespaces &#8212; &lt;tt&gt;aaa&lt;/tt&gt; and &lt;tt&gt;aab&lt;/tt&gt; &#8212; and uses them to explicitly namespace the &lt;tt&gt;id&lt;/tt&gt; attribute as well as the &lt;tt&gt;&lt;root&gt;&lt;/tt&gt; node. I think the output XML string is &lt;em&gt;functionally&lt;/em&gt; equivalent, but it&#039;s clearly not literally equivalent :(</description>
		<content:encoded><![CDATA[<p>It seems like a limitation that <tt>toXmlString()</tt> can&#8217;t handle default namespaces or implicitly defined namespaces. For instance, when you use <tt>xml:id</tt>, you&#8217;re using a namespace <tt>xml</tt> that you don&#8217;t declare, and when you&#8217;re using the default namespace <tt><a href="http://example.com" rel="nofollow">http://example.com</a></tt> that namespace doesn&#8217;t have a binding. <tt>toXmlString()</tt> apparently wants everything to be explicit, so it makes up bindings for the two namespaces &mdash; <tt>aaa</tt> and <tt>aab</tt> &mdash; and uses them to explicitly namespace the <tt>id</tt> attribute as well as the <tt>&lt;root&gt;</tt> node. I think the output XML string is <em>functionally</em> equivalent, but it&#8217;s clearly not literally equivalent :(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Claus Wahlers</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-1331</link>
		<dc:creator>Claus Wahlers</dc:creator>
		<pubDate>Thu, 22 Mar 2007 20:09:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-1331</guid>
		<description>&lt;blockquote&gt;Note that you didn’t have to declare xmlns:xml=”http://www.w3.org/XML/1998/namespace” in the  node, but the attribute was clearly scoped to that namespace. That means AS3 respects its implicit existence. :)&lt;/blockquote&gt;
Yep that&#039;s the way it&#039;s supposed to be. However, toXMLString() seems to behave wrong as it&#039;s adding the xml namespace declaration (which is not valid).
Also namespaceDeclarations() seems to have a general problem when used with XMLLists downcasted to XML (or something)</description>
		<content:encoded><![CDATA[<blockquote><p>Note that you didn’t have to declare xmlns:xml=”http://www.w3.org/XML/1998/namespace” in the  node, but the attribute was clearly scoped to that namespace. That means AS3 respects its implicit existence. :)</p></blockquote>
<p>Yep that&#8217;s the way it&#8217;s supposed to be. However, toXMLString() seems to behave wrong as it&#8217;s adding the xml namespace declaration (which is not valid).<br />
Also namespaceDeclarations() seems to have a general problem when used with XMLLists downcasted to XML (or something)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Braunstein</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-1327</link>
		<dc:creator>Roger Braunstein</dc:creator>
		<pubDate>Thu, 22 Mar 2007 18:50:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-1327</guid>
		<description>Interesting! I didn&#039;t know about &lt;tt&gt;xml:id&lt;/tt&gt;. It appears that for processors that support it, the &lt;tt&gt;xml&lt;/tt&gt; namespace is bound implicitly to http://www.w3.org/XML/1998/namespace, and &lt;tt&gt;id&lt;/tt&gt; is an attribute scoped to this namespace.

AS3 seems to support this. Hurray! Here are some ways you could extract the &lt;tt&gt;id&lt;/tt&gt; attribute. This shows how you can use namespaced attributes as well.

&lt;pre&gt;var b:XML = XML(&apos;&lt;root xmlns=&quot;http://example.com/&quot; xml:id=&quot;wtf&quot; /&gt;&apos;);
trace(b.attributes()[0]); //wtf
trace(b.@id); //null
trace(b.@*::id); //wtf
namespace xml=&quot;http://www.w3.org/XML/1998/namespace&quot;;
trace(b.@xml::id); //wtf&lt;/pre&gt;

Note that you didn&#039;t have to declare &lt;tt&gt;xmlns:xml=&quot;http://www.w3.org/XML/1998/namespace&quot;&lt;/tt&gt; in the &lt;tt&gt;&lt;root/&gt;&lt;/tt&gt; node, but the attribute was clearly scoped to that namespace. That means AS3 respects its implicit existence. :)</description>
		<content:encoded><![CDATA[<p>Interesting! I didn&#8217;t know about <tt>xml:id</tt>. It appears that for processors that support it, the <tt>xml</tt> namespace is bound implicitly to <a href="http://www.w3.org/XML/1998/namespace" rel="nofollow">http://www.w3.org/XML/1998/namespace</a>, and <tt>id</tt> is an attribute scoped to this namespace.</p>
<p>AS3 seems to support this. Hurray! Here are some ways you could extract the <tt>id</tt> attribute. This shows how you can use namespaced attributes as well.</p>
<pre>var b:XML = XML(&apos;&lt;root xmlns=&quot;http://example.com/&quot; xml:id=&quot;wtf&quot; /&gt;&apos;);
trace(b.attributes()[0]); //wtf
trace(b.@id); //null
trace(b.@*::id); //wtf
namespace xml="http://www.w3.org/XML/1998/namespace";
trace(b.@xml::id); //wtf</pre>
<p>Note that you didn&#8217;t have to declare <tt>xmlns:xml="http://www.w3.org/XML/1998/namespace"</tt> in the <tt>&lt;root/&gt;</tt> node, but the attribute was clearly scoped to that namespace. That means AS3 respects its implicit existence. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Claus Wahlers</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-1325</link>
		<dc:creator>Claus Wahlers</dc:creator>
		<pubDate>Thu, 22 Mar 2007 18:24:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-1325</guid>
		<description>&lt;blockquote&gt;What’s up with the semicolon&lt;/blockquote&gt;
Whoops, that must have been an email typo, sorry for that. There&#039;s no lost semicolon in my original code.
&lt;blockquote&gt;and xml: should be xmlns:&lt;/blockquote&gt;
Nope, see here: http://www.w3.org/TR/xml-id/

Shouldn&#039;t b.namespaceDeclarations() also include the default namespace declaration (xmlns=&quot;http://example.com/&quot;), or does that get stripped out because it&#039;s already accessible via b.namespace()?</description>
		<content:encoded><![CDATA[<blockquote><p>What’s up with the semicolon</p></blockquote>
<p>Whoops, that must have been an email typo, sorry for that. There&#8217;s no lost semicolon in my original code.</p>
<blockquote><p>and xml: should be xmlns:</p></blockquote>
<p>Nope, see here: <a href="http://www.w3.org/TR/xml-id/" rel="nofollow">http://www.w3.org/TR/xml-id/</a></p>
<p>Shouldn&#8217;t b.namespaceDeclarations() also include the default namespace declaration (xmlns=&#8221;http://example.com/&#8221;), or does that get stripped out because it&#8217;s already accessible via b.namespace()?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Braunstein</title>
		<link>http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/comment-page-1/#comment-1320</link>
		<dc:creator>Roger Braunstein</dc:creator>
		<pubDate>Thu, 22 Mar 2007 17:08:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.partlyhuman.com/blog/roger/using-e4x-with-xhtml-watch-your-namespaces#comment-1320</guid>
		<description>I think in this example the processing instruction is a &lt;span style=&quot;color:red&quot;&gt;red herring&lt;/span&gt;. You were testing:
&lt;pre&gt;&lt;?xml-stylesheet href=&quot;my.css&quot; type=&quot;text/css&quot;?&gt;
&lt;root xmlns=&quot;http://example.com/&quot;; xml:id=&quot;wtf&quot; /&gt;&lt;/pre&gt;
right? 
But I think that&#039;s not well formed. What&#039;s up with the semicolon, and &lt;tt&gt;xml:&lt;/tt&gt; should be &lt;tt&gt;xmlns:&lt;/tt&gt; Try this:
&lt;pre&gt;var a:XMLList = new XMLList(
   &apos;&lt;?xml-stylesheet href=&quot;my.css&quot; type=&quot;text/css&quot;?&gt;&apos; +
   &apos;&lt;root xmlns=&quot;http://example.com/&quot; xmlns:id=&quot;wtf&quot; /&gt;&apos;);
var b:XML = a[1];
trace(b.namespaceDeclarations()); //wtf
trace(b.namespace()); //http://example.com/&lt;/pre&gt;

&lt;tt&gt;namespaceDeclarations()&lt;/tt&gt; gets the namespaces the node defines, and &lt;tt&gt;namespace()&lt;/tt&gt; gets the namespace the node is in. You can see that the processing instruction has no impact on whether this works.</description>
		<content:encoded><![CDATA[<p>I think in this example the processing instruction is a <span style="color:red">red herring</span>. You were testing:</p>
<pre>&lt;?xml-stylesheet href=&quot;my.css&quot; type=&quot;text/css&quot;?&gt;
&lt;root xmlns=&quot;http://example.com/&quot;; xml:id=&quot;wtf&quot; /&gt;</pre>
<p>right?<br />
But I think that&#8217;s not well formed. What&#8217;s up with the semicolon, and <tt>xml:</tt> should be <tt>xmlns:</tt> Try this:</p>
<pre>var a:XMLList = new XMLList(
   &apos;&lt;?xml-stylesheet href=&quot;my.css&quot; type=&quot;text/css&quot;?&gt;&apos; +
   &apos;&lt;root xmlns=&quot;http://example.com/&quot; xmlns:id=&quot;wtf&quot; /&gt;&apos;);
var b:XML = a[1];
trace(b.namespaceDeclarations()); //wtf
trace(b.namespace()); //http://example.com/</pre>
<p><tt>namespaceDeclarations()</tt> gets the namespaces the node defines, and <tt>namespace()</tt> gets the namespace the node is in. You can see that the processing instruction has no impact on whether this works.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
