<?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>Digital Craft</title>
	<atom:link href="http://www.digitalcraft.com.au/index.php?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.digitalcraft.com.au</link>
	<description>coding experiences by pete schonefeld</description>
	<lastBuildDate>Mon, 07 Jun 2010 09:01:39 +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>it&#8217;s not jquery v. xpath</title>
		<link>http://www.digitalcraft.com.au/?p=129</link>
		<comments>http://www.digitalcraft.com.au/?p=129#comments</comments>
		<pubDate>Sun, 18 Apr 2010 00:51:58 +0000</pubDate>
		<dc:creator>peter schonefeld</dc:creator>
				<category><![CDATA[xpath]]></category>

		<guid isPermaLink="false">http://www.digitalcraft.com.au/?p=129</guid>
		<description><![CDATA[I&#8217;ve been talking to a few developers about what i&#8217;m doing here (building xpath4js) and each time I get the same response, &#8220;Why not just use jquery&#8221;.  Well, as far as I can tell jquery is an all purpose javascript library that does a heap of cool things including some xpath support. jquery would [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been talking to a few developers about what i&#8217;m doing here (building xpath4js) and each time I get the same response, &#8220;Why not just use jquery&#8221;.  Well, as far as I can tell <a href="http://jquery.com/">jquery</a> is an all purpose javascript library that does a heap of cool things including some xpath support. jquery would be useful for use in a production site today and, in that scenario, I would use it too.</p>
<p>Xpath (and particularly xpath 2.0) is all about working with xml and sets of data (sequences of nodes and/or atomic values). With: xml namespace support; function extensibility; and xpath 2.0 being a subset of xquery, it becomes clear that jquery and xpath are two very different things. </p>
<p>Jquery and xpath are not mutually exclusive and it&#8217;d be pretty amazing if in the future jquery was to support xpath 2.0 :p</p>
<p><a href="http://xpath4js.googlecode.com">xpath4js</a> is a GWT implementation of the <a href="http://www.w3.org/TR/xpath20/">XPath 2.0 recommendation</a> of the w3c.  The project is in its early stages and has a *long* way to go, but will be released as a javascript library under the GNU license scheme.</p>
<p>happy coding :)<br />
Pete</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalcraft.com.au/?feed=rss2&amp;p=129</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>chart sample as a js lib via jsni</title>
		<link>http://www.digitalcraft.com.au/?p=113</link>
		<comments>http://www.digitalcraft.com.au/?p=113#comments</comments>
		<pubDate>Sat, 10 Apr 2010 15:22:24 +0000</pubDate>
		<dc:creator>peter schonefeld</dc:creator>
				<category><![CDATA[gwt]]></category>

		<guid isPermaLink="false">http://www.digitalcraft.com.au/?p=113</guid>
		<description><![CDATA[The previous post showed a GWT module that would select data from xml via xpath4js and then render a GWT visualization. That post was designed to show the xpath side of things in action, rather than show a useful way to incorporate google charts into a web site&#8230; Today I thought that it would be [...]]]></description>
			<content:encoded><![CDATA[<p>The previous post showed a GWT module that would select data from xml via xpath4js and then render a GWT visualization. That post was designed to show the xpath side of things in action, rather than show a useful way to incorporate google charts into a web site&#8230; Today I thought that it would be good to show the web page calling Google&#8217;s chart api on demand, passing in the path for the source xml file and the id of the target element for the chart. SO&#8230;</p>
<p><em>normal js inside the html page</em><br/></p>
<div style="border:1px solid #aaa;padding:10px;width:500px;">
<code>
<pre>&lt;script type="text/javascript"&gt;

       function loadCharts(){
            try{
                 doChart("chartinput.xml","divChart");
                 doChart("chartinput2.xml","divChart2");
                 doChart("chartinput3.xml","divChart3");
            }
            catch(err){
                 setTimeout("loadCharts()",1000);
            }
       }
&lt;/script&gt;</pre>
<p></code>
</div>
<p><em>calls the GWT compiled js to do this&#8230;</em><br/></p>
<div id="divChart">&#8230;</div>
<p><br/></p>
<div id="divChart2">&#8230;</div>
<p><br/></p>
<div id="divChart3">&#8230;</div>
<p><br/></p>
<p><strong>IE woes:</strong> The first version of this example worked on FF and Chrome with no problems, however in IE the charts failed to load on the browser re-fresh.  In pinned the problem down to a caching of the js for Google&#8217;s ajax loader API (which loads up the scripts used to render the charts).  As a quick fix for this I injected the js that calls the ajax into the lib&#8217;s onModuleLoad() method with a random value appended to the end of the query string so that the file will be fetched fresh each time (this is a hack, so please do let me know if you know of a better solution). The injection code was directly from google&#8217;s wrapper for the loader&#8230;</p>
<div style="border:1px solid #aaa;padding:10px;width:500px;">
<code>
<pre>
    public void onModuleLoad() {
        // ** need to stop IE from caching ajax loader script,
        //      otherwise will not load on refresh (fubar)
        Document doc = Document.get();
        String src = "http://www.google.com/jsapi?"+
                         "callback=__gwt_AjaxLoader_onLoad" +
                         "&#038;x=" + ((int)(Math.random()*100));
        ScriptElement script = doc.createScriptElement();
        script.setSrc(src);
        script.setType("text/javascript");
        doc.getBody().appendChild(script);
        // end fubar**

        publish();
    }</pre>
<p></code>
</div>
<p>The source for this project (in eclipse) can be found here:</p>
<p><a href="https://code.google.com/p/xpath4js/source/browse/#svn/trunk/samples/googleChartSampleLib">https://code.google.com/p/xpath4js/source/browse/#svn/trunk/samples/googleChartSampleLib</a></p>
<p>happy coding :)<br />
Pete</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalcraft.com.au/?feed=rss2&amp;p=113</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DoXPath(input,&#8221;/chart/data/*&#8221;)</title>
		<link>http://www.digitalcraft.com.au/?p=56</link>
		<comments>http://www.digitalcraft.com.au/?p=56#comments</comments>
		<pubDate>Sun, 04 Apr 2010 11:53:55 +0000</pubDate>
		<dc:creator>peter schonefeld</dc:creator>
				<category><![CDATA[gwt]]></category>
		<category><![CDATA[xpath]]></category>
		<category><![CDATA[google charts]]></category>

		<guid isPermaLink="false">http://www.digitalcraft.com.au/?p=56</guid>
		<description><![CDATA[i&#8217;ve finally had the chance to put together a small demo of xpath4js in action. In short&#8230;1) chart defined in xml; 2) xml loaded &#038; chart data selected via xpath; and 3) the chart is rendered:
Everyone likes to see the best part first&#8230;so here the final product live (interactive gwt visualization fed xml values via [...]]]></description>
			<content:encoded><![CDATA[<p>i&#8217;ve finally had the chance to put together a small demo of xpath4js in action. In short&#8230;1) chart defined in xml; 2) xml loaded &#038; chart data selected via xpath; and 3) the chart is rendered:</p>
<p>Everyone likes to see the best part first&#8230;so here the final product live (interactive gwt visualization fed xml values via xpath4js)</p>
<div id="divChart"></div>
<p>And the behind the scenes&#8230;<br />
<em>XML Chart definition</em><br/></p>
<div style="border:1px solid #aaa;padding:10px;width:500px;border-right:none">
<code>
<pre>&lt;chart type="3D" family="pieChart"&gt;
  &lt;def&gt;
    &lt;background width="400" height="160" style="fill:#fff"/&gt;
    &lt;title&gt;This is the title of my chart&lt;/title&gt;
    &lt;legend show="true"/&gt;
  &lt;/def&gt;
  &lt;data&gt;
    &lt;item&gt;
      &lt;label&gt;A&lt;/label&gt;
      &lt;desc&gt;Item A&lt;/desc&gt;
      &lt;value&gt;20&lt;/value&gt;
    &lt;/item&gt;
    &lt;item&gt;
      &lt;label&gt;B&lt;/label&gt;
      &lt;desc&gt;Item B&lt;/desc&gt;
      &lt;value&gt;13&lt;/value&gt;
    &lt;/item&gt;
    &lt;item&gt;
      &lt;label&gt;C&lt;/label&gt;
      &lt;desc&gt;Item C&lt;/desc&gt;
      &lt;value&gt;3&lt;/value&gt;
    &lt;/item&gt;
    &lt;item&gt;
      &lt;label&gt;D&lt;/label&gt;
      &lt;desc&gt;Item D&lt;/desc&gt;
      &lt;value&gt;7&lt;/value&gt;
    &lt;/item&gt;
  &lt;/data&gt;
&lt;/chart&gt;</pre>
<p></code>
</div>
<p><em>using xpath to select chart data</em><br/></p>
<div style="border:1px solid #aaa;padding:10px;width:500px;border-right:none">
<code>
<pre>import org.xml.xpath4js.client.*;
import com.google.gwt.visualization.client.visualizations.PieChart;
.
.
//parse xml into xpath input sequence
XPathSequence input  = new XPathSequence();
input.AppendItem(new XPathInput(_chartxml).XPathDoc);

// Create a pie chart visualization.
PieChart pie = new PieChart(createTable(input), setupChart(input));
.
.
DataTable data = DataTable.create();
data.addColumn(ColumnType.STRING, "Task");
data.addColumn(ColumnType.NUMBER, "Some Value");

XPathSequence dataitems = EvalEngine.DoXPath(input,"/chart/data/*");
XPathSequence labels = EvalEngine.DoXPath(dataitems,"/item/label/text()");
XPathSequence values = EvalEngine.DoXPath(dataitems,"/item/value/text()");

data.addRows(dataitems.GetSize());
for(int i=0; i&lt;dataitems.GetSize();i++){
  data.setValue(i, 0, labels.GetItemAt(i).GetStringValue());
  data.setValue(i,1,values.GetItemAt(i).GetStringValue());
}</pre>
<p></code>
</div>
<p>Ref:
<ul>
<li>the xpath4js project is here: <a href="http://xpath4js.googlecode.com">http://xpath4js.googlecode.com</a></li>
<li>the code for this example is available from the project&#8217;s source repository <a href="http://code.google.com/p/xpath4js/source/browse/#svn/trunk/samples">here</a> </li>
<li>google charts lives here: <a href="http://code.google.com/apis/charttools/">http://code.google.com/apis/charttools/</a></li>
<li>GWT lives here: <a href="http://code.google.com/webtoolkit/">http://code.google.com/webtoolkit/</a></li>
</ul>
<p>Happy coding :)<br />
Pete</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalcraft.com.au/?feed=rss2&amp;p=56</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>from sx++ to xpath4js</title>
		<link>http://www.digitalcraft.com.au/?p=39</link>
		<comments>http://www.digitalcraft.com.au/?p=39#comments</comments>
		<pubDate>Fri, 26 Mar 2010 09:31:50 +0000</pubDate>
		<dc:creator>peter schonefeld</dc:creator>
				<category><![CDATA[xpath]]></category>
		<category><![CDATA[xml based programming]]></category>

		<guid isPermaLink="false">http://www.digitalcraft.com.au/?p=39</guid>
		<description><![CDATA[Early last decade (or a century ago in tech years) I made good friends with a bloke called Kimanzi Mati &#8216;aka&#8217; Kimmie who was (i&#8217;m sure still is) an inventor.  Kimmie&#8217;s invention was a programming language/runtime environment called SuperX++ and man! did it have the X factor!!  SuperX++ was an environment designed with the idea [...]]]></description>
			<content:encoded><![CDATA[<p><span>Early last decade (or a century ago in tech years) I made good friends with a bloke called <span>Kimanzi</span> <span>Mati</span> &#8216;aka&#8217; Kimmie who was (<span>i&#8217;m</span> sure still is) an inventor.  Kimmie&#8217;s invention was a programming language/<span>runtime</span> environment called <span>SuperX</span>++ and man! did it have the X factor!!  <span>SuperX</span>++ was an environment designed with the idea that, one day, objects could be instilled with intelligence and autonomy&#8230;growing, living and learning entities&#8230;in <span>SuperX</span>++ objects would remember and have the ability to write their own programs that could extend across time in the <span>sx</span>++ memorial. Fact is that many people who came across <span>SuperX</span>++ thought that it was (is) pretty special.</span></p>
<p><span>Some might say that such &#8216;flights of fantasy&#8217; are just the basis of over active imaginations &#8212; perhaps &#8212; but even so such imaginings formed the basis of a furious <span>exchange</span> of emails that lasted for many months&#8230;it is true that discoursing with Kimmie was like being a small part of some thing amazing&#8230;it was like being there at the big bang of a new universe or at the very least watching as a </span><a href="http://en.wikipedia.org/wiki/Permutation_City"><em>Permutation City</em></a> was being born.</p>
<p><span>I must mention that everything about <span>sx</span>++ was XML based.</span></p>
<p><span><span>sx</span>++ was a GNU project and I wanted to contribute by building the infrastructure for neural pathways that objects would use to deliver packets (or fragments) of information to one another&#8230;luckily for me the technology for delivering these pathways (or <span>xpathways</span> :) had already been devised and all i needed to do was implement a then draft specification of the W3C&#8230; we talking about 2003/4 here i think&#8230;I can&#8217;t remember!</span></p>
<p><strong><span>xpath4j</span></strong>s: The current version of the project that I&#8217;ve just created at <a href="http://code.google.com/p/xpath4js">http://code.google.com/p/xpath4js</a><span> was written in c++ and, as sad as it is to say, never reached integration stage with <span>sx</span>++. But that&#8217;s OK&#8230;for all its potential I think <span>SuperX</span>++ was too far ahead of it&#8217;s time.  Kimmie wrote the <span>sx</span>++ compiler at machine level and I feel that Kimmie thought that he had to do this in order to get the level of control of the environment that he required. My mind&#8217;s at the other end of the scale and think that the true &#8216;poweful&#8217; environment is <span>javaScript</span> in the web browser or user agent (let&#8217;s not limit the form of the js sandbox). So a few months ago, I decided to convert my <span>xpath</span> 2.0 <span>eval</span> engine to java for compilation to <span>javaScript</span> via GWT. My aim is to take reliance for critical data access away from the underlying browser and, with full credit to the amazing efforts of the team that has built GWT, the task was pretty easy.</span></p>
<p>There is a lot to do to get this on spec, top of my list:</p>
<ul>
<li>Add a few key functionalities currently missing (i.e. predicate expression evaluation and function support);</li>
<li>Update the implementation to the final W3C recommendation (I can&#8217;t even remember the exact version that this has been built to having lost my printout of the draft spec in a recent house moving event);</li>
<li><span>Develop a full system for <span>xpath</span> unit tests.</span></li>
</ul>
<p><span>Currently it seems to run pretty good in FF&#8230;so i will be playing with the lib in the context of some general GWT development.</span></p>
<p><img class="alignnone size-thumbnail wp-image-42" style="float:left" title="super x++ logo" src="http://www.digitalcraft.com.au/wp-content/uploads/2010/03/xppLrg-150x150.gif" alt="super x++ logo" width="150" height="150" /></p>
<p><span>It&#8217;s my hope that one day Kimmie will decide to bring <span>SuperX</span>++ back from hibernation. It is such a powerful idea.  Perhaps I can talk him into reinventing the environment into js&#8230;who knows what the future brings!!</span></p>
<p><span>PS: I just found the web site for <span>Superx</span>++: </span><a href="http://xplusplus.sourceforge.net/">http://xplusplus.sourceforge.net/</a><span> sweet!! and Just a note <span>superx</span>++ has no relation to the current search results for <span>superx</span>++ in google.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalcraft.com.au/?feed=rss2&amp;p=39</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hello world</title>
		<link>http://www.digitalcraft.com.au/?p=24</link>
		<comments>http://www.digitalcraft.com.au/?p=24#comments</comments>
		<pubDate>Tue, 16 Mar 2010 08:05:37 +0000</pubDate>
		<dc:creator>peter schonefeld</dc:creator>
				<category><![CDATA[stuff]]></category>

		<guid isPermaLink="false">http://www.digitalcraft.com.au/?p=24</guid>
		<description><![CDATA[I wonder how many coder blogs start off with &#8220;hello world&#8221; as the first post title? Google: first post blog &#8220;hello world&#8221; &#8230; plenty&#8230; well, here&#8217;s another one!
Ahem. [now for the part of my first blog post that explains why I'm starting a blog]
I&#8217;ve been coding for a while now (since about 1995 as a [...]]]></description>
			<content:encoded><![CDATA[<p>I wonder how many coder blogs start off with &#8220;hello world&#8221; as the first post title? Google: <em>first post blog &#8220;hello world&#8221;</em> &#8230; plenty&#8230; well, here&#8217;s another one!</p>
<p>Ahem. [now for the part of my first blog post that explains why I'm starting a blog]</p>
<p>I&#8217;ve been coding for a while now (since about 1995 as a hobby and since 2000 as a profession) and in this time have come accross some pretty amazing technologies. Of these technologies one in particular has (risking over dramatisation) changed my life &#8212; that is XML.</p>
<p>I remember it was the office rage in about 1997 when all the Gartner reports were predicting that, within ten years, XML would be used in eighty percent of software. Sorry Gartner, you got it wrong&#8230;I&#8217;d say XML was used to develop close to 100% of new software products, especially if you include IDEs in that box&#8230;So I wandered off all enthusiastic about programming and XML and got my formal qualifications (that piece of paper rolled up in the back of some cupboard at home) and in 2000 started freelancing as a web developer.</p>
<p>People that know me understand that I&#8217;ve got bit of an artistic bent which explains why I was playing with Adobe Illustrator in around 2001 when I noticed this odd little plug-in thing caled <em>the Adobe SVG Viewer</em>&#8230;I remember specifically this cool little rotate animation of a bi-plane. It wasn&#8217;t until a year or two later that I decided to update my web site (digitalcraft.com.au) to feature data driven SVG and articles bagging Flash (how times change!). This started what was, for me,  the best few years of coding fun ever&#8230;until now&#8230;</p>
<p>About a year ago I started building an iGoogle gadget for the blog where I post my art readings. At the time I exclaimed out loud &#8220;This is pretty cool! I think i&#8217;ll really keep my eye on what Google are doing in the web2.0 space!!&#8221;, (joke!) this was even though I&#8217;d been using Google docs for several years at the time ;)  But gadgets did spark my interest in Google&#8217;s efforts when I can accross two google projects just about the same day <strong>svgweb</strong> and <strong>GWT</strong>&#8230;so since then I&#8217;ve been pottering away on some pretty fun stuff and am now ready to share my self indulgent hacks with the rest of the world.</p>
<p>So, as they now say, watch this blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalcraft.com.au/?feed=rss2&amp;p=24</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
