<?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>Johns Blog &#187; XML</title>
	<atom:link href="http://blogs.gnome.org/johncarr/tag/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/johncarr</link>
	<description>Making your brain invert and fall out of your ear since 2007</description>
	<lastBuildDate>Mon, 29 Mar 2010 16:37:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A new XmlObject</title>
		<link>http://blogs.gnome.org/johncarr/2007/04/15/a-new-xmlobject/</link>
		<comments>http://blogs.gnome.org/johncarr/2007/04/15/a-new-xmlobject/#comments</comments>
		<pubDate>Sun, 15 Apr 2007 22:47:10 +0000</pubDate>
		<dc:creator>John Carr</dc:creator>
				<category><![CDATA[Nerd]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/johncarr/?p=25</guid>
		<description><![CDATA[I&#8217;ve become somewhat addicted to the SqlObject stuff in TurboGears. After reading and reading my book (and finishing my first skim through) I was left with an appetite to put it to good use. Obviously theres Conduit.net. But I ended up thinking about the state of the data types in conduit. I remember implementing the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve become somewhat addicted to the <a href="http://www.sqlobject.org/">SqlObject</a> stuff in <a href="http://www.turbogears.org/">TurboGears</a>. After reading and reading my book (and finishing my first skim through) I was left with an appetite to put it to good use. Obviously theres Conduit.net. But I ended up thinking about the state of the data types in conduit. I remember implementing the <a href="http://www.conduit-project.org/browser/trunk/conduit/datatypes/Contact.py">contact datatype</a>, and it&#8217;s always been in a pretty sorry state. Your best hope for working with the data was to directly work with self.vObject, which I have zero-understanding of. On top of that, we want to use the <a href="http://www.opensync.org/">OpenSync</a> XML schemas in Conduit to aid interoperability with it, <a href="http://www.synce.org/">SynCE</a> and to help with any networking layers we add (Conduit-web, Avahi/Twisted).</p>
<p>Could there possibly be an SqlObject equivalent for Xml? At first glance, yes and no. <a href="http://sourceforge.net/projects/xmlobject/">XMLObject</a> would seem to be dead? You have to craft a parser, and there seems to be a compilation step. Another <a href="http://www.freenet.org.nz/python/xmlobject/">XMLObject</a> seems better. It doesn&#8217;t seem to have the magic glue that SQLObject does, and you don&#8217;t seem to be able to create your own &#8220;model objects&#8221;. <a href="http://xmlobject.base-art.net/">EaseXML</a> is the closest to what I want, but it too seems dead?</p>
<p>Anyway, at the moment I am hacking away on my own implementation as bit of a learning  tool. I&#8217;ve implemented the latest OpenSync Note schema in my objects and have something that looks like this:</p>
<p><code>class Note(xmlobject.XmlObject):<br />
Body = MultiText(maxOccurs=1, minOccurs=1)<br />
Categories = Categories(maxOccurs=1, minOccurs=0)<br />
Class = Class()<br />
DateCreated = DateTimeContent()<br />
LastModified = DateTimeContent()<br />
Summary = MultiText()<br />
XIrmcLuid = StringContent()</code></p>
<p>And am able to produce some dummy output using Note().get_xml()</p>
<p><code>&lt;Note&gt;<br />
&lt;Body Language="Language" AlternativeTextRep="AlternativeTextRep"&gt;<br />
&lt;Content&gt;Content&lt;/Content&gt;<br />
&lt;/Body&gt;<br />
&lt;LastModified TimezoneID="TimezoneID" DateValue="DateValue"&gt;<br />
&lt;Content&gt;Content&lt;/Content&gt;<br />
&lt;/LastModified&gt;<br />
&lt;Summary Language="Language" AlternativeTextRep="AlternativeTextRep"&gt;<br />
&lt;Content&gt;Content&lt;/Content&gt;<br />
&lt;/Summary&gt;<br />
&lt;XIrmcLuid&gt;<br />
&lt;Content&gt;Content&lt;/Content&gt;<br />
&lt;/XIrmcLuid&gt;<br />
&lt;DateCreated TimezoneID="TimezoneID" DateValue="DateValue"&gt;<br />
&lt;Content&gt;Content&lt;/Content&gt;<br />
&lt;/DateCreated&gt;<br />
&lt;Class&gt;<br />
&lt;ClassValue&gt;ClassValue&lt;/ClassValue&gt;<br />
&lt;/Class&gt;<br />
&lt;Categories&gt;<br />
&lt;Category&gt;Category&lt;/Category&gt;<br />
&lt;/Categories&gt;<br />
&lt;/Note&gt;</code></p>
<p>It&#8217;s all pretty dirty and basic right now. But it&#8217;s going pretty well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/johncarr/2007/04/15/a-new-xmlobject/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blogs.gnome.org/johncarr/tag/xml/feed/ ) in 1.22768 seconds, on Feb 10th, 2012 at 7:13 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 10th, 2012 at 8:13 pm UTC -->
