<?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>BadPopcorn &#187; XML</title>
	<atom:link href="http://badpopcorn.com/blog/category/technology/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://badpopcorn.com/blog</link>
	<description>Solutions for anything... except popcorn.</description>
	<lastBuildDate>Mon, 12 Apr 2010 15:38:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Use app:accept, screw the Atom Categories</title>
		<link>http://badpopcorn.com/blog/2007/07/26/use-appaccept-screw-the-atom-categories/</link>
		<comments>http://badpopcorn.com/blog/2007/07/26/use-appaccept-screw-the-atom-categories/#comments</comments>
		<pubDate>Thu, 26 Jul 2007 10:08:04 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[REST]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://badpopcorn.com/2007/07/26/use-appaccept-screw-the-atom-categories/</guid>
		<description><![CDATA[It&#8217;s been a while since I&#8217;ve revisited the Atom Publishing Protocol, so I just had to review (briefly) the latest APP Draft (17) since it&#8217;s probably going to be the one that becomes an RFC standard. I noticed something that I must have overlooked before: the app:accept element. Without even looking through the past drafts, [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I&#8217;ve revisited the Atom Publishing Protocol, so I just had to review (briefly) the latest APP Draft (17) since it&#8217;s probably going to be the one that becomes an RFC standard. I noticed something that I must have overlooked before: the app:accept element. Without even looking through the past drafts, I have a gut feeling that it&#8217;s been in the APP for quite some time; and I have the feeling that I had a <a href="http://badpopcorn.com/2006/09/21/atom-categories-its-potential/">misguided pursuit of using Atom Categories</a> as service type descriptions.</p>
<p>On the surface, one may think that the app:accept is just for giving the mime-type of whatever resource one wants to create in an APP Collection: jpeg, gif, some xml. Let&#8217;s look at the &#8220;application/xml&#8221; mime-type. It describes many many XML documents that represent many resources. One may be a shopping cart order, or it may represent a classified ad. And this is why I may have overlooked the accept element before: a generic mime-type is generally too broad for describing the semantic meaning of the Resource represented using said mime-type.</p>
<p>But, one can aptly describe the what &#8220;Service&#8221; a server will provide as a side effect after one POSTs a new Resource to a collection (for creation) by using the Accept Extensions as described in the APP app:accept section&#8211; note that app:accept refers to Accept Header section (14.1) in <a href="http://www.faqs.org/rfcs/rfc2616.html">RFC2616</a>. Examples of such side effects are the creation of other Resources in other Collections by the server.</p>
<p>So, in the app:accept example in the new APP Draft (17), it is implicitly suggested to use the &#8220;type&#8221; extension to describe, semantically, what a Collection will accept and process server side. Example: `application/atom+xml;type=entry` for normal atom entries. In my services now, I can add some extra domain specific restrictions on POSTed Resources with an app:accept like `application/xml;type=&#8221;http://example.com/online_orders/flower_basket_order.dtd&#8221;`. But don&#8217;t use DTDs, it&#8217;s just an example. <img src='http://badpopcorn.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Or try `application/xml;type=com.example.some.resource.type`. Note that one has to be careful about quoting (&#8220;) values. In the first case, I had the separators (as defined in RFC26162) slash (/) and colon (:) in my URI; where as the second case had no separators. And also note that what one (as a good APP citizen) POSTs Resources, not RPC requests.</p>
<p>So what are Categories good for? I haven&#8217;t had much time to reflect on that, so maybe it&#8217;s good to use Categories if I had a generic &#8220;http://example.com/online_order.dtd&#8221; resource type that is used for all types of orders: flower baskets, bicycles, or electronics. Have a Collection for bike orders whose category may be &#8220;http://example.com/bikes&#8221;, and another for Flowers&#8230;</p>
<p>And all this makes sense to me because we want to be Resource Oriented, and mime-types are the preferred route in describing Resources. I say this is good stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://badpopcorn.com/blog/2007/07/26/use-appaccept-screw-the-atom-categories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RDFa Complexities</title>
		<link>http://badpopcorn.com/blog/2007/03/18/rdfa-complexities/</link>
		<comments>http://badpopcorn.com/blog/2007/03/18/rdfa-complexities/#comments</comments>
		<pubDate>Sun, 18 Mar 2007 09:12:51 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://badpopcorn.com/2007/03/18/rdfa-complexities/</guid>
		<description><![CDATA[So I briefly read over the new draft of the RDFa Primer. It&#8217;s good overall, but Section 5 introduces unnecessary interpretation complexities.
I say BLEAH to the Section 5. I want &#8220;Keep It Simple, Stupid.&#8221; parsing. The nested layers make it harder for the parser to parse; it makes it harder for the lay person to [...]]]></description>
			<content:encoded><![CDATA[<p>So I briefly read over the new draft of the <a href="http://www.w3.org/TR/xhtml-rdfa-primer/">RDFa Primer</a>. It&#8217;s good overall, but Section 5 introduces unnecessary interpretation complexities.</p>
<p>I say <strong>BLEAH</strong> to the Section 5. I want &#8220;Keep It Simple, Stupid.&#8221; parsing. The nested layers make it harder for the parser to parse; it makes it harder for the lay person to understand RDFa (and to adopt, and to use).</p>
<p>I also <strong>REALLY</strong> don&#8217;t like the idea of intermixing the id and about attributes for use in defining the subjects &amp; objects. Although the primer makes a case for it, I counter with this example:</p>
<p>&lt;body about=&#8221;http://example.com/mydoc#section&#8221;&gt;<br />
  &lt;div id=&#8221;popup&#8221;&gt;<br />
    The document was written by &lt;span rel=&#8221;dc:author&#8221;&gt;Tim&lt;/span&gt;<br />
  &lt;/div&gt;<br />
  &lt;a onClick=&#8221;&#8230;&#8221;&gt;Show PopUp&lt;/a&gt;<br />
&lt;/body&gt;</p>
<p>The &#8216;popup&#8217; id is overloaded. It&#8217;s the identifier for which the Javascript code looks up, and it&#8217;s also become the subject of the dc:author statement. The above fragment is also non-intuitive. I would expect &lt;http://example.com/mydoc#section&gt; dc:author &#8216;Tim&#8217;. Instead, I get &lt;#popup&gt; dc:author &#8216;Tim&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://badpopcorn.com/blog/2007/03/18/rdfa-complexities/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FeedMesh Python Solution</title>
		<link>http://badpopcorn.com/blog/2005/11/11/feedmesh-python-solution/</link>
		<comments>http://badpopcorn.com/blog/2005/11/11/feedmesh-python-solution/#comments</comments>
		<pubDate>Fri, 11 Nov 2005 19:11:47 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://badpopcorn.com/?p=46</guid>
		<description><![CDATA[Ralph Meijer&#8217;s blog has a nice entry about connecting to the FeedMesh network, even with sample code.
This solution was exactly what I was looking for. The Twisted Framework is used for handling both the network connection and the XML streaming (Xish package).
However, I ran into a little problem when testing the code out. I found [...]]]></description>
			<content:encoded><![CDATA[<p>Ralph Meijer&#8217;s blog has a <a href="http://ralphm.net/blog/2005/10/08/twisted_sprint">nice entry</a> about connecting to the FeedMesh network, even with sample code.</p>
<p>This solution was exactly what I was looking for. The <a href="http://www.twistedmatrix.com/">Twisted Framework</a> is used for handling both the network connection and the XML streaming (<a href="http://twistedmatrix.com/projects/xish/">Xish package</a>).</p>
<p>However, I ran into a little problem when testing the code out. I found was that the XmlStreamFactory failed to instantiate. It required another parameter in its constructor. WTF? </p>
<p>Simple reason. Ralph has been making changes to remove all the Jabber specific stuff out of Xish. That parameter was for Jabber and Ralph&#8217;s changes haven&#8217;t made it out into a new release.</p>
<p>So, for those that already have Xish 0.1.0 installed, here are the following code changes:</p>
<pre>auth = xmlstream.Authenticator('')
f = xmlstream.XmlStreamFactory(auth)
</pre>
<p><span id="more-46"></span><br />
Original Sample Code:</p>
<pre>from twisted.xish import xmlstream
from twisted.internet import reactor

def onPing(element):
    print 'Ping for %s' % (element['rss'])

def connected(xs):
    print 'Connected!'
    xs.addObserver('/weblog', onPing)

f = xmlstream.XmlStreamFactory()
f.addBootstrap(xmlstream.STREAM_START_EVENT, connected)

reactor.connectTCP('sandbox.pubsub.com', 9999, f)
reactor.run()
</pre>
<p>[Edited: Changed the code tag to a pre tag (Of the code samples) because those sections weren't rendering nicely.]</p>
]]></content:encoded>
			<wfw:commentRss>http://badpopcorn.com/blog/2005/11/11/feedmesh-python-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
