<?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>Eric van der Vlist</title>
	<atom:link href="http://eric.van-der-vlist.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://eric.van-der-vlist.com/blog</link>
	<description>XML, apiculture et prés-vergers</description>
	<lastBuildDate>Mon, 17 Jun 2013 17:31:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>When MVC becomes a burden for XForms &#8211; XML London 2013</title>
		<link>http://eric.van-der-vlist.com/blog/2013/06/17/when-mvc-becomes-a-burden-for-xforms-xml-london-2013/</link>
		<comments>http://eric.van-der-vlist.com/blog/2013/06/17/when-mvc-becomes-a-burden-for-xforms-xml-london-2013/#comments</comments>
		<pubDate>Mon, 17 Jun 2013 14:24:04 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Programming/Programmation]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[betterform]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[orbeon forms]]></category>
		<category><![CDATA[xbl]]></category>
		<category><![CDATA[xforms]]></category>
		<category><![CDATA[xsltforms]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=878</guid>
		<description><![CDATA[This paper, presented at XML London 2013, is also available as a presentation and as a screencast: Your browser does not support the video element. Abstract XForms is gaining traction and is being used to develop complex forms, revealing its &#8230; <a href="http://eric.van-der-vlist.com/blog/2013/06/17/when-mvc-becomes-a-burden-for-xforms-xml-london-2013/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This paper, presented at <a href="http://xmllondon.com/">XML London 2013</a>, is also available as a <a href="https://dyomedea.com/papers/2013-xmllondon/">presentation</a> and as a screencast:</p>
<p><video width="512" height="384" src="https://dyomedea.com/papers/2013-xmllondon/videos/screencast.ogv" controls="controls" preload="metadata"> Your browser does not support the <code>video</code> element.<br />
</video></p>
<div class="abstract">
<h2>Abstract</h2>
<p>XForms is gaining traction and is being used to develop complex forms, revealing its strengths but also its weaknesses.</p>
<p>One of the latest is not specific to XForms but inherent to the MVC (Model View Controller) architecture which is one of the bases of XForms.</p>
<p>In this talk we see how the MVC architecture dramatically affect the modularity and reusabilty of XForms developments and some of the solutions used to work around this flaw.</p>
</div>
<div class="toc">
<h2>Table of Contents</h2>
<dl>
<dt><span class="section"><a href="#d5e21">Practice: a quiz</a></span></dt>
<dd>
<dl>
<dt><span class="section"><a href="#d5e24">Basic XForms</a></span></dt>
<dt><span class="section"><a href="#d5e39">Using instances and actions</a></span></dt>
<dt><span class="section"><a href="#d5e53">Modularity</a></span></dt>
<dt><span class="section"><a href="#d5e69">Homework: repeated content</a></span></dt>
<dt><span class="section"><a href="#d5e74">What&#8217;s the problem?</a></span></dt>
</dl>
</dd>
<dt><span class="section"><a href="#d5e77">Theory: the MVC design pattern</a></span></dt>
<dt><span class="section"><a href="#d5e129">Solutions</a></span></dt>
<dd>
<dl>
<dt><span class="section"><a href="#d5e132">Copy/Paste</a></span></dt>
<dt><span class="section"><a href="#d5e136">XForms generation or templating</a></span></dt>
<dt><span class="section"><a href="#d5e160">Orbeon Forms&#8217; XBL implementation</a></span></dt>
<dt><span class="section"><a href="#d5e191">Subforms</a></span></dt>
</dl>
</dd>
<dt><span class="section"><a href="#d5e307">Conclusion</a></span></dt>
<dd>
<dl>
<dt><span class="section"><a href="#d5e342">Acknowledgments</a></span></dt>
</dl>
</dd>
</dl>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e21"></a>Practice: a quiz</h2>
</div>
</div>
</div>
<p>Let&#8217;s start with a quiz&#8230;</p>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e24"></a>Basic XForms</h3>
</div>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="d5e26"></a>Question</h4>
</div>
</div>
</div>
<p>Given the following instance:</p>
<pre class="brush: xml">&lt;figures&gt;
   &lt;line&gt;
      &lt;length&gt;
         &lt;value&gt;10&lt;/value&gt;
         &lt;unit&gt;in&lt;/unit&gt;
      &lt;/length&gt;
   &lt;/line&gt;
&lt;/figures&gt;</pre>
<p>implement a standard XForms 1.1 form displaying the following user interface:<span class="inlinemediaobject"><img alt="" src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2013/06/quiz.png" /></span></p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="d5e33"></a>Answer</h4>
</div>
</div>
</div>
<p>Model:</p>
<pre class="brush: xml">&lt;xf:model&gt;
   &lt;xf:instance&gt;
      &lt;figures&gt;
         &lt;line&gt;
            &lt;length&gt;
               &lt;value&gt;10&lt;/value&gt;
               &lt;unit&gt;in&lt;/unit&gt;
            &lt;/length&gt;
         &lt;/line&gt;
      &lt;/figures&gt;
   &lt;/xf:instance&gt;
&lt;/xf:model&gt;</pre>
<p>View:</p>
<pre class="brush: xml">&lt;xf:group ref="line/length"&gt;
   &lt;xf:input ref="value"&gt;
      &lt;xf:label&gt;Length: &lt;/xf:label&gt;
   &lt;/xf:input&gt;
   &lt;xf:select1 ref="unit"&gt;
      &lt;xf:label&gt;&lt;/xf:label&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;pixels&lt;/xf:label&gt;
         &lt;xf:value&gt;px&lt;/xf:value&gt;
      &lt;/xf:item&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;font size&lt;/xf:label&gt;
         &lt;xf:value&gt;em&lt;/xf:value&gt;
      &lt;/xf:item&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;font height&lt;/xf:label&gt;
         &lt;xf:value&gt;ex&lt;/xf:value&gt;
      &lt;/xf:item&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;inches&lt;/xf:label&gt;
         &lt;xf:value&gt;in&lt;/xf:value&gt;
      &lt;/xf:item&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;centimeters&lt;/xf:label&gt;
         &lt;xf:value&gt;cm&lt;/xf:value&gt;
      &lt;/xf:item&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;millimeters&lt;/xf:label&gt;
         &lt;xf:value&gt;mm&lt;/xf:value&gt;
      &lt;/xf:item&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;points&lt;/xf:label&gt;
         &lt;xf:value&gt;pt&lt;/xf:value&gt;
      &lt;/xf:item&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;picas&lt;/xf:label&gt;
         &lt;xf:value&gt;pc&lt;/xf:value&gt;
      &lt;/xf:item&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;%&lt;/xf:label&gt;
         &lt;xf:value&gt;%&lt;/xf:value&gt;
      &lt;/xf:item&gt;
   &lt;/xf:select1&gt;
&lt;/xf:group&gt;</pre>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e39"></a>Using instances and actions</h3>
</div>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="d5e41"></a>Question</h4>
</div>
</div>
</div>
<p>Implement the same user interface if the instance uses the CSS2 / SVG 1.1 conventions for sizes:</p>
<pre class="brush: xml">&lt;xf:instance id="main"&gt;
   &lt;figures&gt;
      &lt;line length="10in"/&gt;
   &lt;/figures&gt;
&lt;/xf:instance&gt;</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="d5e45"></a>Answer</h4>
</div>
</div>
</div>
<p>Model:</p>
<pre class="brush: xml">&lt;xf:model&gt;
   &lt;xf:instance id="main"&gt;
      &lt;figures&gt;
         &lt;line length="10in"/&gt;
      &lt;/figures&gt;
   &lt;/xf:instance&gt;
   &lt;xf:instance id="split"&gt;
      &lt;line&gt;
         &lt;length&gt;
            &lt;value/&gt;
            &lt;unit/&gt;
         &lt;/length&gt;
      &lt;/line&gt;
   &lt;/xf:instance&gt;
   .../...
&lt;/xf:model&gt;</pre>
<p>View:</p>
<pre class="brush: xml">&lt;xf:group ref="instance('split')/length"&gt;
   &lt;xf:input ref="value" id="length-control"&gt;
      &lt;xf:label&gt;Length: &lt;/xf:label&gt;
   &lt;/xf:input&gt;
   &lt;xf:select1 ref="unit" id="unit-control"&gt;
      &lt;xf:label/&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;pixels&lt;/xf:label&gt;
         &lt;xf:value&gt;px&lt;/xf:value&gt;
      &lt;/xf:item&gt;
      .../...
      &lt;xf:item&gt;
         &lt;xf:label&gt;%&lt;/xf:label&gt;
         &lt;xf:value&gt;%&lt;/xf:value&gt;
      &lt;/xf:item&gt;
   &lt;/xf:select1&gt;
&lt;/xf:group&gt;</pre>
<p>Controller:</p>
<pre class="brush: xml">&lt;xf:model&gt;
   .../...
   &lt;xf:action ev:event="xforms-ready"&gt;
      &lt;xf:setvalue ref="instance('split')/length/value" value="translate(instance('main')/line/@length, '%incmptxe', '')"/&gt;
      &lt;xf:setvalue ref="instance('split')/length/unit" value="translate(instance('main')/line/@length, '0123456789', '')"/&gt;
   &lt;/xf:action&gt;
   &lt;xf:action ev:event="xforms-value-changed" ev:observer="length-control"&gt;
      &lt;xf:setvalue ref="instance('main')/line/@length" value="concat(instance('split')/length/value, instance('split')/length/unit)"/&gt;
   &lt;/xf:action&gt;
   &lt;xf:action ev:event="xforms-value-changed" ev:observer="unit-control"&gt;
      &lt;xf:setvalue ref="instance('main')/line/@length" value="concat(instance('split')/length/value, instance('split')/length/unit)"/&gt;
   &lt;/xf:action&gt;
&lt;/xf:model&gt;</pre>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e53"></a>Modularity</h3>
</div>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="d5e55"></a>Question</h4>
</div>
</div>
</div>
<p>Still using XForms 1.1 standard features, extend this user interface to edit the height and width of a rectangle:</p>
<pre class="brush: xml">&lt;xf:instance id="main"&gt;
   &lt;figures&gt;
      &lt;rectangle height="10in" width="4em"/&gt;
   &lt;/figures&gt;
&lt;/xf:instance&gt;</pre>
<p><span class="bold"><strong>Hint</strong></span>: copy/paste is your friend!</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="d5e61"></a>Answer</h4>
</div>
</div>
</div>
<p>Model:</p>
<pre class="brush: xml">&lt;xf:model&gt;
   &lt;xf:instance id="main"&gt;
      &lt;figures&gt;
         &lt;rectangle height="10in" width="4em"/&gt;
      &lt;/figures&gt;
   &lt;/xf:instance&gt;
   &lt;xf:instance id="height"&gt;
      &lt;height&gt;
         &lt;value/&gt;
         &lt;unit/&gt;
      &lt;/height&gt;
   &lt;/xf:instance&gt;
   .../...
   &lt;xf:instance id="width"&gt;
      &lt;width&gt;
         &lt;value/&gt;
         &lt;unit/&gt;
      &lt;/width&gt;
   &lt;/xf:instance&gt;
   .../...
&lt;/xf:model&gt;</pre>
<p>View:</p>
<pre class="brush: xml">&lt;xf:group ref="instance('height')"&gt;
   &lt;xf:input ref="value" id="height-value-control"&gt;
      &lt;xf:label&gt;Height: &lt;/xf:label&gt;
   &lt;/xf:input&gt;
   &lt;xf:select1 ref="unit" id="height-unit-control"&gt;
      &lt;xf:label/&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;pixels&lt;/xf:label&gt;
         &lt;xf:value&gt;px&lt;/xf:value&gt;
      &lt;/xf:item&gt;
      .../...
   &lt;/xf:select1&gt;
&lt;/xf:group&gt;
&lt;xh:br/&gt;
&lt;xf:group ref="instance('width')"&gt;
   &lt;xf:input ref="value" id="width-value-control"&gt;
      &lt;xf:label&gt;Width: &lt;/xf:label&gt;
   &lt;/xf:input&gt;
   &lt;xf:select1 ref="unit" id="width-unit-control"&gt;
      &lt;xf:label/&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;pixels&lt;/xf:label&gt;
         &lt;xf:value&gt;px&lt;/xf:value&gt;
      &lt;/xf:item&gt;
      .../...
   &lt;/xf:select1&gt;
&lt;/xf:group&gt;</pre>
<p>Controller:</p>
<pre class="brush: xml">&lt;xf:model&gt;
   .../...
   &lt;xf:action ev:event="xforms-ready"&gt;
      &lt;xf:setvalue ref="instance('height')/value" value="translate(instance('main')/rectangle/@height, '%incmptxe', '')"/&gt;
      &lt;xf:setvalue ref="instance('height')/unit" value="translate(instance('main')/rectangle/@height, '0123456789', '')"/&gt;
   &lt;/xf:action&gt;
   &lt;xf:action ev:event="xforms-value-changed" ev:observer="height-value-control"&gt;
      &lt;xf:setvalue ref="instance('main')/rectangle/@height" value="concat(instance('height')/value, instance('height')/unit)"/&gt;
   &lt;/xf:action&gt;
   &lt;xf:action ev:event="xforms-value-changed" ev:observer="height-unit-control"&gt;
      &lt;xf:setvalue ref="instance('main')/rectangle/@height" value="concat(instance('height')/value, instance('height')/unit)"/&gt;
   &lt;/xf:action&gt;
   .../...
   &lt;xf:action ev:event="xforms-ready"&gt;
      &lt;xf:setvalue ref="instance('width')/value" value="translate(instance('main')/rectangle/@width, '%incmptxe', '')"/&gt;
      &lt;xf:setvalue ref="instance('width')/unit" value="translate(instance('main')/rectangle/@width, '0123456789', '')"/&gt;
   &lt;/xf:action&gt;
   &lt;xf:action ev:event="xforms-value-changed" ev:observer="width-value-control"&gt;
      &lt;xf:setvalue ref="instance('main')/rectangle/@width" value="concat(instance('width')/value, instance('width')/unit)"/&gt;
   &lt;/xf:action&gt;
   &lt;xf:action ev:event="xforms-value-changed" ev:observer="width-unit-control"&gt;
      &lt;xf:setvalue ref="instance('main')/rectangle/@width" value="concat(instance('width')/value, instance('width')/unit)"/&gt;
   &lt;/xf:action&gt;
&lt;/xf:model&gt;</pre>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e69"></a>Homework: repeated content</h3>
</div>
</div>
</div>
<p>Still using standard XForms features, extend this form to support any number of rectangles in the instance.</p>
<p><span class="bold"><strong>Hint</strong></span>: you will not be able to stick to atomic instances for the width and height but act more globally and maintain instances with a set of dimensions which you&#8217;ll have to keep synchronized with the main instance when rectangles are inserted or deleted.</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e74"></a>What&#8217;s the problem?</h3>
</div>
</div>
</div>
<p>XForms lacks a feature to define and use &#8220;components&#8221; that would package a group of controls together with their associated model and actions.</p>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e77"></a>Theory: the MVC design pattern</h2>
</div>
</div>
</div>
<p>XForms <a class="link" href="http://http://www.w3.org/TR/xforms11/" target="_blank">describes itself</a> as a <a class="link" href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller" target="_blank">MVC </a>architecture:</p>
<div class="blockquote">
<blockquote class="blockquote"><p>An XForm allows processing of data to occur using three mechanisms:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">a declarative <span class="bold"><strong>model</strong></span> composed of formulae for data<br />
calculations and constraints, data type and other property declarations, and data submission<br />
parameters</li>
<li class="listitem">a <span class="bold"><strong>view</strong></span> layer composed of intent-based user interface<br />
controls</li>
<li class="listitem">an imperative <span class="bold"><strong>controller</strong></span> for orchestrating data<br />
manipulations, interactions between the model and view layers, and data submissions.</li>
</ul>
</div>
</blockquote>
</div>
<p>Micah Dubinko <a class="link" href="http://http://dubinko.info/blog/2010/09/02/is-xforms-really-mvc/" target="_blank">argues</a> that the mapping is more obvious with <a class="link" href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter" target="_blank">Model-view-presenter<br />
(MVP)</a>, a derivative of the MVC software pattern but that’s not the point I’d like to make and<br />
I’ll stick to the MVC terminology where:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">The model is composed of XForms instances and binds</li>
<li class="listitem">The view is composed of the XForms controls together with the HTML elements and CSS stylesheets</li>
<li class="listitem">The controller is composed of the actions</li>
</ul>
</div>
<div class="mediaobject">
<table style="cellpadding: 0; cellspacing: 0;" summary="manufactured viewport for HTML img" width="500" border="0">
<tbody>
<tr>
<td><img alt="" src="https://dyomedea.com/papers/2013-xmllondon/images/MVC-Process.svg" width="500" /></td>
</tr>
</tbody>
</table>
<div class="caption">
<p><a class="link" href="http://commons.wikimedia.org/wiki/File:MVC-Process.svg" target="_blank"> Mode-view-controler on wikimedia </a></p>
</div>
</div>
<p><a class="link" href="http://wiki.orbeon.com/forms/doc/user-guide/form-builder-user-guide" target="_blank">Orbeon Form Builder</a>/<a class="link" href="http://wiki.orbeon.com/forms/doc/user-guide/form-runner-user-guide" target="_blank">Form Runner</a> go one step forward and add a fourth concern for localization and we get a model/view/localization/controller pattern.</p>
<p>This <a class="link" href="http://en.wikipedia.org/wiki/Separation_of_concerns" target="_blank">separation of concerns</a> is great to differentiate different roles and split work between specialists but doesn’t play well with <a class="link" href="http://http://en.wikipedia.org/wiki/Modular_programming" target="_blank">modularity</a> and <a class="link" href="http://en.wikipedia.org/wiki/Reusability" target="_blank">reusability</a>.</p>
<p>I am currently working on a project to develop big and complex forms and this is becoming one of the biggest issues: these forms share a number of common fields and group of fields and, not even speaking of sharing these definitions, this separation of concerns adds a significant burden when copying these definitions from one form to another.</p>
<p>To copy a field from one form to another you need to copy definitions from the model, the view, the localization and the controller and can’t just copy a “component”.</p>
<p>And of course, there is no easy way to reuse common components instead of copying them.</p>
<p>This kind of issue is common with the MVC design pattern and the <a class="link" href="http://en.wikipedia.org/wiki/Hierarchical_model%E2%80%93view%E2%80%93controller" target="_blank">Hierarchical model–view–controller (HMVC)</a> has been <a class="link" href="http://www.javaworld.com/javaworld/jw-07-2000/jw-0721-hmvc.html" target="_blank">introduced for this purpose</a>, but how can we use such a pattern with XForms?</p>
<div class="mediaobject">
<table style="cellpadding: 0; cellspacing: 0;" summary="manufactured viewport for HTML img" width="425" border="0">
<tbody>
<tr>
<td><img alt="" src="https://dyomedea.com/papers/2013-xmllondon/images/jw-0721-hmvc1.gif" width="425" /></td>
</tr>
</tbody>
</table>
<div class="caption">
<p><a class="link" href="http://www.javaworld.com/javaworld/jw-07-2000/jw-0721-hmvc.html?page=2" target="_blank">Hierarchical model-view-controller in JavaWorld</a></p>
</div>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e129"></a>Solutions</h2>
</div>
</div>
</div>
<p>A number of solutions are being used to work around this issue with XForms.</p>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e132"></a>Copy/Paste</h3>
</div>
</div>
</div>
<p>This is what we&#8217;ve done for our quiz and we&#8217;ve seen that this is easy -but very verbose and hard to maintain- until we start to deal with repeated content.</p>
<p>I would guess that this is the most common practice when fields (or group of fields) are being reused in XForms though!</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e136"></a>XForms generation or templating</h3>
</div>
</div>
</div>
<p>We&#8217;re XML developers, aren&#8217;t we? When something is verbose we can use XSLT or any other tool to generate it and XForms is no exception.</p>
<p>XForms can be generated from any kind of model including annotated schemas or other vocabularies such as <a class="link" href="http://en.wikipedia.org/wiki/Data_Documentation_Initiative" target="_blank">DDI</a> (we&#8217;ll be presenting this option at the <a class="link" href="http://www.balisage.net/XML-Interfaces/index.html" target="_blank">Balisage International Symposium on Native XML User Interfaces</a> in August.</p>
<p>Projects without any obvious model formats in mind often chose to transform simplified versions of XForms into plain XForms. In that case the approach may tends toward a templating system where placeholders are inserted into XForms documents to be transformed into proper XForms.</p>
<p>We may want for instance to define <code class="code">&lt;my:dimension/&gt;</code> placeholders which would look like XForms controls and generate the whole model, view and controller XForms definitions.</p>
<p>The source form would then be something as simple as:</p>
<pre class="brush: xml">&lt;xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
   xmlns:my="http://ns.dyomedea.com/my-components/"&gt;
   &lt;xh:head&gt;
      &lt;xh:title&gt;Template&lt;/xh:title&gt;
      &lt;xf:model&gt;
         &lt;xf:instance id="main"&gt;
            &lt;figures&gt;
               &lt;rectangle height="10in" width="4em"/&gt;
            &lt;/figures&gt;
         &lt;/xf:instance&gt;
      &lt;/xf:model&gt;
   &lt;/xh:head&gt;
   &lt;xh:body&gt;
      &lt;my:dimension ref="rectangle/@height"&gt;
         &lt;xf:label&gt;Height&lt;/xf:label&gt;
      &lt;/my:dimension&gt;
      &lt;br/&gt;
      &lt;my:dimension ref="rectangle/@width"&gt;
         &lt;xf:label&gt;Width&lt;/xf:label&gt;
      &lt;/my:dimension&gt;
   &lt;/xh:body&gt;
&lt;/xh:html&gt;</pre>
<p>A simplistic version of a transformation to process this example is not overly complex. The controls are quite easy to generate from the placeholders:</p>
<pre class="brush: xml">&lt;xsl:template match="my:dimension"&gt;
    &lt;xsl:variable name="id" select="if (@id) then @id else generate-id()"/&gt;
    &lt;xf:group ref="instance('{$id}-instance')"&gt;
        &lt;xf:input ref="value" id="{$id}-value-control"&gt;
            &lt;xsl:apply-templates/&gt;
        &lt;/xf:input&gt;
        &lt;xf:select1 ref="unit" id="{$id}-unit-control"&gt;
            &lt;xf:label/&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;pixels&lt;/xf:label&gt;
                &lt;xf:value&gt;px&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            .../...
        &lt;/xf:select1&gt;
    &lt;/xf:group&gt;
&lt;/xsl:template&gt;</pre>
<p>A model can be appended to the <code class="code">&lt;xh:head/&gt; </code>element:</p>
<pre class="brush: xml">&lt;xsl:template match="xh:head"&gt;
    &lt;xsl:copy&gt;
        &lt;xsl:apply-templates select="@*|node()" mode="#current"/&gt;
        &lt;xf:model&gt;
            &lt;xsl:apply-templates select="//my:dimension" mode="model"/&gt;
        &lt;/xf:model&gt;
    &lt;/xsl:copy&gt;
&lt;/xsl:template&gt;</pre>
<p>And the instances and actions can be generated similarly:</p>
<pre class="brush: xml">&lt;xsl:template match="my:dimension" mode="model"&gt;
    &lt;xsl:variable name="id" select="if (@id) then @id else generate-id()"/&gt;
    &lt;xf:instance id="{$id}-instance"&gt;
        &lt;height&gt;
            &lt;value/&gt;
            &lt;unit/&gt;
        &lt;/height&gt;
    &lt;/xf:instance&gt;
    &lt;xf:action ev:event="xforms-ready"&gt;
        &lt;xf:setvalue ref="instance('{$id}-instance')/value"
            value="translate(instance('main')/{@ref}, '%incmptxe', '')"/&gt;
        &lt;xf:setvalue ref="instance('{$id}-instance')/unit"
            value="translate(instance('main')/{@ref}, '0123456789', '')"/&gt;
    &lt;/xf:action&gt;
    &lt;xf:action ev:event="xforms-value-changed" ev:observer="{$id}-value-control"&gt;
        &lt;xf:setvalue ref="instance('main')/{@ref}"
            value="concat(instance('{$id}-instance')/value, instance('{$id}-instance')/unit)"/&gt;
    &lt;/xf:action&gt;
    &lt;xf:action ev:event="xforms-value-changed" ev:observer="{$id}-unit-control"&gt;
        &lt;xf:setvalue ref="instance('main')/{@ref}"
            value="concat(instance('{$id}-instance')/value, instance('{$id}-instance')/unit)"/&gt;
    &lt;/xf:action&gt;
&lt;/xsl:template&gt;</pre>
<p>As always, the devil is in details and this would be far from perfect:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">In actions, references to the main instance do not take into account the context node under which the <code class="code">&lt;my:dimension/&gt;</code> placeholder is defined (paths are therefore<br />
expected to be relative to the default instance). Mimicking the behavior of an XForms control and its support of the context node would be much more challenging.</li>
<li class="listitem">Supporting repetitions would be another challenge.</li>
</ul>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e160"></a>Orbeon Forms&#8217; XBL implementation</h3>
</div>
</div>
</div>
<p><a class="link" href="http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide" target="_blank">Orbeon&#8217;s<br />
component architecture</a> is inspired by XBL 2.0 which describes itself as:</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">XBL (the Xenogamous Binding Language) describes the ability to associate elements in a document with script, event handlers, CSS, and more complex content models, which can be stored in another document. This can be used to re-order and wrap content so that, for instance, simple HTML or XHTML markup can have complex CSS styles applied without requiring that the markup be polluted with multiple semantically neutral div elements.It can also be used to implement new DOM interfaces, and, in conjunction with other specifications, enables arbitrary tag sets to be implemented as widgets. For example, XBL could be used to implement the form controls in XForms or HTML.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution"><a class="link" href="http://www.w3.org/TR/xbl/" target="_blank">XBL 2.0</a></span></td>
</tr>
</tbody>
</table>
</div>
<p>Even if this specification is no longer maintained by the W3C Web Applications Working Group, the concepts described in XBL 2.0 fit very nicely in the context of XForms documents even though the syntax may sometimes look strange, such as when CSS selectors are used where XPath patterns would look more natural in XForms documents.</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>The syntax of XBL declarations has been changed between Orbeon Forms version 3 and 4. The syntax shown in this paper is the syntax of version 4.</p>
</div>
<p>The definition of an XBL component to implement our dimension widget would be composed of three parts: handlers, implementation and template:</p>
<pre class="brush: xml">&lt;xbl:binding id="my-dimension" element="my|dimension" xxbl:mode="lhha binding value"&gt;
   &lt;xbl:handlers&gt;
      .../...
   &lt;/xbl:handlers&gt;
   &lt;xbl:implementation&gt;
      .../...
   &lt;/xbl:implementation&gt;
   &lt;xbl:template&gt;
      .../...
   &lt;/xbl:template&gt;
&lt;/xbl:binding&gt;</pre>
<p>A fourth element could be added to define component specific resources such as CSS stylesheets.</p>
<p>The XForms component&#8217;s model goes into the implementation:</p>
<pre class="brush: xml">&lt;xbl:implementation&gt;
   &lt;xf:model id="my-dimension-model"&gt;
      &lt;xf:instance id="my-dimension-instance"&gt;
         &lt;dimension&gt;
            &lt;value/&gt;
            &lt;unit/&gt;
         &lt;/dimension&gt;
      &lt;/xf:instance&gt;
      .../...
&lt;/xbl:implementation&gt;</pre>
<p>The XForms component&#8217;s controls are defined into the template:</p>
<pre class="brush: xml">&lt;xbl:template&gt;
   &lt;xf:input ref="value" id="my-dimension-value-control"/&gt;
   &lt;xf:select1 ref="unit" id="my-dimension-unit-control"&gt;
      &lt;xf:label/&gt;
      &lt;xf:item&gt;
         &lt;xf:label&gt;pixels&lt;/xf:label&gt;
         &lt;xf:value&gt;px&lt;/xf:value&gt;
      &lt;/xf:item&gt;
      .../...
   &lt;/xf:select1&gt;
&lt;/xbl:template&gt;</pre>
<p>The XForms actions are split between the handlers and the implementation (or the template): handlers are used to define actions triggered by events which are external to the component (such as in our case <code class="code">xforms-ready</code>) while traditional XForms actions are used to handle events &#8220;internal&#8221; to the component such as user actions.</p>
<p>The handlers would thus be:</p>
<pre class="brush: xml">&lt;xbl:handlers&gt;
   &lt;xbl:handler event="xforms-enabled xforms-value-changed"&gt;
      &lt;xf:setvalue ref="instance('my-dimension-instance')/value" 
          value="translate(xxf:binding('my-dimension'), '%incmptxe', '')"/&gt;
      &lt;xf:setvalue ref="instance('my-dimension-instance')/unit" 
          value="translate(xxf:binding('my-dimension'), '0123456789', '')"/&gt;
   &lt;/xbl:handler&gt;
&lt;/xbl:handlers&gt;</pre>
<p>And the remaining actions:</p>
<pre class="brush: xml">&lt;xbl:implementation&gt;
   &lt;xf:model id="my-dimension-model"&gt;
      .../...
      &lt;xf:setvalue ev:event="xforms-value-changed" ev:observer="my-dimension-value-control" 
          ref="xxf:binding('my-dimension')" 
          value="concat(instance('my-dimension-instance')/value, instance('my-dimension-instance')/unit)"/&gt;
      &lt;xf:setvalue ev:event="xforms-value-changed" ev:observer="my-dimension-unit-control" 
          ref="xxf:binding('my-dimension')" 
          value="concat(instance('my-dimension-instance')/value, instance('my-dimension-instance')/unit)"/&gt;
   &lt;/xf:model&gt;
&lt;/xbl:implementation&gt;</pre>
<p>I won&#8217;t go into the details which are described in Orbeon&#8217;s <a class="link" href="http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide" target="_blank">XBL &#8211; Guide to Using and Writing XBL Components</a> but it is worth noting that there is a strict encapsulation of both the model, the view and the controller of this component that seen from the outside acts as a standard XForms control.</p>
<p>Of course, this component can be used as a standard XForms control:</p>
<pre class="brush: xml">&lt;xh:body&gt;
   &lt;my:dimension ref="rectangle/@height"&gt;
      &lt;xf:label&gt;Height&lt;/xf:label&gt;
   &lt;/my:dimension&gt;
   &lt;br/&gt;
   &lt;my:dimension ref="rectangle/@width"&gt;
      &lt;xf:label&gt;Width&lt;/xf:label&gt;
   &lt;/my:dimension&gt;
&lt;/xh:body&gt;</pre>
<p>The complete form with the component definition would be:</p>
<pre class="brush: xml">&lt;?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?&gt;
&lt;?xsltforms-options debug="yes"?&gt;
&lt;xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
   xmlns:xxf="http://orbeon.org/oxf/xml/xforms" xmlns:ev="http://www.w3.org/2001/xml-events"
   xmlns:xbl="http://www.w3.org/ns/xbl" xmlns:xxbl="http://orbeon.org/oxf/xml/xbl"
   xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:my="http://ns.dyomedea.com/my-components/"&gt;
   &lt;xh:head&gt;
      &lt;xh:title&gt;Simple XBL Component&lt;/xh:title&gt;
      &lt;xbl:xbl script-type="application/xhtml+xml"&gt;
         &lt;xbl:binding id="my-dimension" element="my|dimension" xxbl:mode="lhha binding value"&gt;
            &lt;xbl:handlers&gt;
               &lt;xbl:handler event="xforms-enabled xforms-value-changed"&gt;
                  &lt;xf:setvalue ref="instance('my-dimension-instance')/value" value="translate(xxf:binding('my-dimension'), '%incmptxe', '')"/&gt;
                  &lt;xf:setvalue ref="instance('my-dimension-instance')/unit" value="translate(xxf:binding('my-dimension'), '0123456789', '')"/&gt;
               &lt;/xbl:handler&gt;
            &lt;/xbl:handlers&gt;
            &lt;xbl:implementation&gt;
               &lt;xf:model id="my-dimension-model"&gt;
                  &lt;xf:instance id="my-dimension-instance"&gt;
                     &lt;dimension&gt;
                        &lt;value/&gt;
                        &lt;unit/&gt;
                     &lt;/dimension&gt;
                  &lt;/xf:instance&gt;
                  &lt;xf:setvalue ev:event="xforms-value-changed" ev:observer="my-dimension-value-control" ref="xxf:binding('my-dimension')" value="concat(instance('my-dimension-instance')/value, instance('my-dimension-instance')/unit)"/&gt;
                  &lt;xf:setvalue ev:event="xforms-value-changed" ev:observer="my-dimension-unit-control" ref="xxf:binding('my-dimension')" value="concat(instance('my-dimension-instance')/value, instance('my-dimension-instance')/unit)"/&gt;
               &lt;/xf:model&gt;
            &lt;/xbl:implementation&gt;
            &lt;xbl:template&gt;
               &lt;xf:input ref="value" id="my-dimension-value-control"/&gt;
               &lt;xf:select1 ref="unit" id="my-dimension-unit-control"&gt;
                  &lt;xf:label/&gt;
                  &lt;xf:item&gt;
                     &lt;xf:label&gt;pixels&lt;/xf:label&gt;
                     &lt;xf:value&gt;px&lt;/xf:value&gt;
                  &lt;/xf:item&gt;
                  &lt;xf:item&gt;
                     &lt;xf:label&gt;font size&lt;/xf:label&gt;
                     &lt;xf:value&gt;em&lt;/xf:value&gt;
                  &lt;/xf:item&gt;
                  &lt;xf:item&gt;
                     &lt;xf:label&gt;font height&lt;/xf:label&gt;
                     &lt;xf:value&gt;ex&lt;/xf:value&gt;
                  &lt;/xf:item&gt;
                  &lt;xf:item&gt;
                     &lt;xf:label&gt;inches&lt;/xf:label&gt;
                     &lt;xf:value&gt;in&lt;/xf:value&gt;
                  &lt;/xf:item&gt;
                  &lt;xf:item&gt;
                     &lt;xf:label&gt;centimeters&lt;/xf:label&gt;
                     &lt;xf:value&gt;cm&lt;/xf:value&gt;
                  &lt;/xf:item&gt;
                  &lt;xf:item&gt;
                     &lt;xf:label&gt;millimeters&lt;/xf:label&gt;
                     &lt;xf:value&gt;mm&lt;/xf:value&gt;
                  &lt;/xf:item&gt;
                  &lt;xf:item&gt;
                     &lt;xf:label&gt;points&lt;/xf:label&gt;
                     &lt;xf:value&gt;pt&lt;/xf:value&gt;
                  &lt;/xf:item&gt;
                  &lt;xf:item&gt;
                     &lt;xf:label&gt;picas&lt;/xf:label&gt;
                     &lt;xf:value&gt;pc&lt;/xf:value&gt;
                  &lt;/xf:item&gt;
                  &lt;xf:item&gt;
                     &lt;xf:label&gt;%&lt;/xf:label&gt;
                     &lt;xf:value&gt;%&lt;/xf:value&gt;
                  &lt;/xf:item&gt;
               &lt;/xf:select1&gt;
            &lt;/xbl:template&gt;
         &lt;/xbl:binding&gt;
      &lt;/xbl:xbl&gt;

      &lt;xf:model&gt;
         &lt;xf:instance id="main"&gt;
            &lt;figures&gt;
               &lt;rectangle height="10in" width="4em"/&gt;
            &lt;/figures&gt;
         &lt;/xf:instance&gt;

      &lt;/xf:model&gt;
   &lt;/xh:head&gt;
   &lt;xh:body&gt;
      &lt;my:dimension ref="rectangle/@height"&gt;
         &lt;xf:label&gt;Height&lt;/xf:label&gt;
      &lt;/my:dimension&gt;
      &lt;br/&gt;
      &lt;my:dimension ref="rectangle/@width"&gt;
         &lt;xf:label&gt;Width&lt;/xf:label&gt;
      &lt;/my:dimension&gt;

      &lt;fr:xforms-inspector/&gt;
   &lt;/xh:body&gt;
&lt;/xh:html&gt;</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e191"></a>Subforms</h3>
</div>
</div>
</div>
<p>Subforms are implemented by <a class="link" href="http://www.agencexml.com/xsltforms" target="_blank">XSLTForms</a> and <a class="link" href="http://www.betterform.de/en/index.html" target="_blank">betterFORM</a>. They have been considered for inclusion in XForms 2.0 but no consensus have been reached and they won&#8217;t be included in 2.0.</p>
<p>There are a number of differences between the XSLTForms and betterFORM implementations but the principle -and the shortcomings- are the same.</p>
<p>The basic principle behind subforms is to embed (or load) a form within another one. This embedding must be specifically performed using an <code class="code">&lt;xf:load&gt;</code> action with a <code class="code">@show="embed"</code> attribute. Subforms can also be unloaded.</p>
<p>The fact that subforms are explicitly loaded and unloaded in their &#8220;master&#8221; form is a key feature for big forms where this mechanism reduces the consumption of resources and leads to important performance improvements.</p>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="d5e201"></a>Subforms, betterFORM flavor</h4>
</div>
</div>
</div>
<p>Subforms are described, in the <a class="link" href="http://betterform.wordpress.com/modularizing-forms/" target="_blank">betterFORM documentation</a>, as <span class="quote">“<span class="quote">a way to avoid redundancies and keep the documents maintainable</span>”</span>:</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">As XForms follows a MVC architecture the XForms model is the first logical candidate when decomposing larger forms into smaller pieces. Aggregating more complex forms from little snippets of UI (or snippets of a model) is a limited approach as the interesting parts are located on the bind Elements. This is where controls learn about their constraints, states, calculations and data types. Instead of just glueing pieces of markup together the inclusion of complete models allow the reuse of all the semantics defined within them.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution"><a class="link" href="http://betterform.wordpress.com/modularizing-forms/" target="_blank">betterFORM<br />
&#8220;Modularizing forms&#8221;</a></span></td>
</tr>
</tbody>
</table>
</div>
<p><a class="link" href="http://www.betterform.de/en/whoweare.html" target="_blank">Joern Turner</a>, founder of Chiba and co-founder of betterFORM, makes it clear that subforms haven&#8217;t been introduced to implement components, though:</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Sorry i need to get a bit philosophic here but subforms are called subforms as they are *not* components <img src='http://eric.van-der-vlist.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  I don&#8217;t want to dive into academic discussions here but the main difference for us is that from a component you would expect to use it as a part of a form as a means to edit one or probably several values in your form and encapsulate the editing logic inside of it. A subform on the other hand should be designed to be completely standalone. Typically we build our subforms as complete xhtml documents which can be run and tested standalone without being a part of a host document.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution"><a class="link" href="http://sourceforge.net/mailarchive/message.php?msg_id=30884969" target="_blank">Joern Turner on the betterform-users mailing list</a></span></td>
</tr>
</tbody>
</table>
</div>
<p>A proper solution for components, based on Web Components) should be implemented in betterFORM 6:</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">We have also considered to implement this [XBL] but decided against it due to the acceptance and future of XBL and due to the fact that we found it overly complex and academic. We will come up with our own component model in betterFORM 6 which will orient at more modern approaches (Web Components).</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution"><a class="link" href="http://sourceforge.net/mailarchive/message.php?msg_id=30927847" target="_blank">Joern Turner on the betterform-users mailing list</a></span></td>
</tr>
</tbody>
</table>
</div>
<p>In the meantime it is still possible to use subforms to design component like features assuming we take into account the following constraints:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem"><a class="link" href="http://betterform.wordpress.com/2012/03/26/xforms-model-to-model-communication/" target="_blank">Communications between the master form and the subform</a> are done using either<br />
in memory submissions (ContextSubmissionHandler identified by a <code class="code">model:</code><br />
pseudo protocol), the <code class="code">instanceOfModel()</code> function which gives access to<br />
instances from other models or custom events passing context information.</li>
<li class="listitem">There is no id collision between the main form and the subforms which are loaded<br />
simultaneously.</li>
</ul>
</div>
<p>This second constraint should be released in the future but the current version of the processor doesn&#8217;t address it. In practice it means that in our sample we cannot load simultaneously an instance of the subform to edit the width and a second instance to edit the height but we can still take a &#8220;master/slave approach&#8221; where a single instance of the subform will be used to edit the width and the height separately or mimic an &#8220;update in place feature&#8221; where an instance of the subform will replace the display of the width or height.</p>
<p>A way to implement our example using these principles could be:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">In the master form:
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle;">
<li class="listitem">Define an instance used as an interface with the subform to carry the<br />
value to edit and identify the active subform instance.</li>
<li class="listitem">Include triggers to load and unload subforms.</li>
<li class="listitem">Define actions to load and unload the subforms and maintain the<br />
&#8220;interface&#8221; instance.</li>
<li class="listitem">Control when to display the triggers to avoid that simultaneous loads of<br />
the subform.</li>
</ul>
</div>
</li>
<li class="listitem">In the subforms:
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle;">
<li class="listitem">Synchronize the local model with the instance used as an interface.</li>
<li class="listitem">Perform all the logic attached to the component.</li>
</ul>
</div>
</li>
</ul>
</div>
<p>The master form would then be:</p>
<pre class="brush: xml">&lt;xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:xf="http://www.w3.org/2002/xforms"&gt;
    &lt;xh:head&gt;
        &lt;xh:title&gt;Subforms&lt;/xh:title&gt;
        &lt;xf:model id="master"&gt;
            &lt;xf:instance id="main"&gt;
                &lt;figures&gt;
                    &lt;rectangle height="10in" width="4em"/&gt;
                &lt;/figures&gt;
            &lt;/xf:instance&gt;

            &lt;!-- Instance used as an "interface" with the subform --&gt;
            &lt;xf:instance id="dimension-interface"&gt;
                &lt;dimension active=""/&gt;
            &lt;/xf:instance&gt;
        &lt;/xf:model&gt;

        &lt;!-- Dirty hack to style controls inline --&gt;
        &lt;xh:style type="text/css"&gt;&lt;![CDATA[

.xfContainer div {
    display: inline !important;
}

.xfContainer span {
    display: inline !important;
}
]]&gt;
        &lt;/xh:style&gt;
    &lt;/xh:head&gt;
    &lt;xh:body&gt;
        &lt;xf:group ref="rectangle"&gt;
            &lt;!-- Height --&gt;
            &lt;xf:group ref="@height"&gt;
                &lt;xf:label&gt;Height: &lt;/xf:label&gt;
                &lt;!-- This should be displayed when the subform is not editing the height --&gt;
                &lt;xf:group ref=".[instance('dimension-interface')/@active!='height']"&gt;
                    &lt;xf:output ref="."/&gt;
                    &lt;!-- Display the trigger when the subform is not loaded anywhere --&gt;
                    &lt;xf:trigger ref=".[instance('dimension-interface')/@active = '']"&gt;
                        &lt;xf:label&gt;Edit&lt;/xf:label&gt;
                        &lt;xf:action ev:event="DOMActivate"&gt;
                            &lt;!-- Set the value of the interface instance --&gt;
                            &lt;xf:setvalue ref="instance('dimension-interface')" value="instance('main')/rectangle/@height"/&gt;
                            &lt;!-- Remember that we are editing the height --&gt;
                            &lt;xf:setvalue ref="instance('dimension-interface')/@active"&gt;height&lt;/xf:setvalue&gt;
                            &lt;!-- Load the subform --&gt;
                            &lt;xf:load show="embed" targetid="height" resource="subform-embedded.xhtml"/&gt;
                        &lt;/xf:action&gt;
                    &lt;/xf:trigger&gt;
                &lt;/xf:group&gt;
                &lt;xh:div id="height"/&gt;
                &lt;!-- This should be displayed only when we're editing the height --&gt;
                &lt;xf:group ref=".[instance('dimension-interface')/@active='height']"&gt;
                    &lt;xf:trigger&gt;
                        &lt;xf:label&gt;Done&lt;/xf:label&gt;
                        &lt;xf:action ev:event="DOMActivate"&gt;
                            &lt;!-- Copy the value from the interface instance --&gt;
                            &lt;xf:setvalue value="instance('dimension-interface')" ref="instance('main')/rectangle/@height"/&gt;
                            &lt;!-- We're no longer editing any dimension --&gt;
                            &lt;xf:setvalue ref="instance('dimension-interface')/@active"/&gt;
                            &lt;!-- Unload the subform --&gt;
                            &lt;xf:load show="none" targetid="height"/&gt;
                        &lt;/xf:action&gt;
                    &lt;/xf:trigger&gt;
                &lt;/xf:group&gt;
            &lt;/xf:group&gt;
            &lt;br/&gt;
            &lt;!-- Width --&gt;
            &lt;xf:group ref="@width"&gt;
                &lt;xf:label&gt;Width: &lt;/xf:label&gt;
                &lt;xf:group ref=".[instance('dimension-interface')/@active!='width']"&gt;
                    &lt;xf:output ref="."/&gt;
                    &lt;xf:trigger ref=".[instance('dimension-interface')/@active = '']"&gt;
                        &lt;xf:label&gt;Edit&lt;/xf:label&gt;
                        &lt;xf:action ev:event="DOMActivate"&gt;
                            &lt;xf:setvalue ref="instance('dimension-interface')" value="instance('main')/rectangle/@width"/&gt;
                            &lt;xf:setvalue ref="instance('dimension-interface')/@active"&gt;width&lt;/xf:setvalue&gt;
                            &lt;xf:load show="embed" targetid="width" resource="subform-embedded.xhtml"/&gt;
                        &lt;/xf:action&gt;
                    &lt;/xf:trigger&gt;
                &lt;/xf:group&gt;
                &lt;xh:div id="width"/&gt;
                &lt;xf:group ref=".[instance('dimension-interface')/@active='width']"&gt;
                    &lt;xf:trigger&gt;
                        &lt;xf:label&gt;Done&lt;/xf:label&gt;
                        &lt;xf:action ev:event="DOMActivate"&gt;
                            &lt;xf:setvalue value="instance('dimension-interface')" ref="instance('main')/rectangle/@width"/&gt;
                            &lt;xf:setvalue ref="instance('dimension-interface')/@active"/&gt;
                            &lt;xf:load show="none" targetid="width"/&gt;
                        &lt;/xf:action&gt;
                    &lt;/xf:trigger&gt;
                &lt;/xf:group&gt;
            &lt;/xf:group&gt;
        &lt;/xf:group&gt;
    &lt;/xh:body&gt;
&lt;/xh:html&gt;</pre>
<p>And the subform:</p>
<pre class="brush: xml">&lt;xh:div xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:xf="http://www.w3.org/2002/xforms"&gt;
    &lt;xf:model id="dimension-model"&gt;
        &lt;xf:instance id="concat"&gt;
            &lt;data/&gt;
        &lt;/xf:instance&gt;
        &lt;xf:instance id="split"&gt;
            &lt;height&gt;
                &lt;value/&gt;
                &lt;unit/&gt;
            &lt;/height&gt;
        &lt;/xf:instance&gt;
        &lt;!-- Get the value from the "interface" instance and initialize the   --&gt;
        &lt;xf:submission id="get-dimension-value" resource="model:master#instance('dimension-interface')/*"
            replace="instance" method="get"&gt;
            &lt;xf:action ev:event="xforms-submit-done"&gt;
                &lt;!--&lt;xf:message level="ephemeral"&gt;Subform has updated itself.&lt;/xf:message&gt;--&gt;
                &lt;xf:setvalue ref="instance('split')/value" value="translate(instance('concat'), '%incmptxe', '')"/&gt;
                &lt;xf:setvalue ref="instance('split')/unit" value="translate(instance('concat'), '0123456789', '')"/&gt;
            &lt;/xf:action&gt;
            &lt;xf:message ev:event="xforms-submit-error" level="ephemeral"&gt;Error while subform update.&lt;/xf:message&gt;
        &lt;/xf:submission&gt;
        &lt;xf:send ev:event="xforms-ready" submission="get-dimension-value"/&gt;
        &lt;xf:submission id="set-dimension-value" resource="model:master#instance('dimension-interface')/*" replace="none"
            method="post"&gt;
            &lt;xf:action ev:event="xforms-submit-done"&gt;
                &lt;!--&lt;xf:message level="ephemeral"&gt;Main form has been updated&lt;/xf:message&gt;--&gt;
            &lt;/xf:action&gt;
            &lt;xf:message ev:event="xforms-submit-error" level="ephemeral"&gt;Error while main form update.&lt;/xf:message&gt;
        &lt;/xf:submission&gt;
    &lt;/xf:model&gt;
    &lt;xf:group ref="instance('split')"&gt;
        &lt;xf:input ref="value"&gt;
            &lt;xf:action ev:event="xforms-value-changed"&gt;
                &lt;xf:setvalue ref="instance('concat')" value="concat(instance('split')/value, instance('split')/unit)"/&gt;
                &lt;xf:send submission="set-dimension-value"/&gt;
            &lt;/xf:action&gt;
        &lt;/xf:input&gt;
        &lt;xf:select1 ref="unit"&gt;
            &lt;xf:action ev:event="xforms-value-changed"&gt;
                &lt;xf:setvalue ref="instance('concat')" value="concat(instance('split')/value, instance('split')/unit)"/&gt;
                &lt;xf:send submission="set-dimension-value"/&gt;
            &lt;/xf:action&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;pixels&lt;/xf:label&gt;
                &lt;xf:value&gt;px&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;font size&lt;/xf:label&gt;
                &lt;xf:value&gt;em&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;font height&lt;/xf:label&gt;
                &lt;xf:value&gt;ex&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;inches&lt;/xf:label&gt;
                &lt;xf:value&gt;in&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;centimeters&lt;/xf:label&gt;
                &lt;xf:value&gt;cm&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;millimeters&lt;/xf:label&gt;
                &lt;xf:value&gt;mm&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;points&lt;/xf:label&gt;
                &lt;xf:value&gt;pt&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;picas&lt;/xf:label&gt;
                &lt;xf:value&gt;pc&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;%&lt;/xf:label&gt;
                &lt;xf:value&gt;%&lt;/xf:value&gt;
            &lt;/xf:item&gt;
        &lt;/xf:select1&gt;
    &lt;/xf:group&gt;
&lt;/xh:div&gt;</pre>
<p>The code for defining the subform has the same level of complexity than the definition of the XBL in Orbeon Forms but a lot of geeky stuff needs to be added around the invocation of the form which becomes tricky.</p>
<p>From a user perspective, the page would initially look like:<span class="inlinemediaobject"><img alt="" src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2013/06/betterform1.png" /></span></p>
<p>When a user clicks on one of the &#8220;Edit&#8221; buttons, the corresponding subform is loaded (note that all the &#8220;Edit&#8221; buttons have disappeared):<span class="inlinemediaobject"><img alt="" src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2013/06/betterform2.png" /></span></p>
<p>Once the user is done editing the values in this subform, (s)he can click on &#8220;Done&#8221; to come back to a state where both the height and width are displayed and can be edited:<span class="inlinemediaobject"><img alt="" src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2013/06/betterform3.png" /></span></p>
<p>The presentation can be improved replacing for instance the buttons by trendy icons but we had to bend our requirements to get something that can be implemented with subforms.</p>
<p>Of course here we are misusing subforms to implement components, something which was not a design goal, and it&#8217;s not surprising that the resulting code is more verbose and that we&#8217;ve had to accept a different user interface. The future component feature announced by Joern Turner should solve these glitches.</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="d5e269"></a>Subforms, XSLTForms flavor</h4>
</div>
</div>
</div>
<p>The support of subforms in XSLTForms is illustrated by a sample: a <a class="link" href="http://sourceforge.net/p/xsltforms/code/ci/master/tree/testsuite/samples/writers.xhtml" target="_blank">writers.xhtml</a> master form embeds a <a class="link" href="http://sourceforge.net/p/xsltforms/code/ci/master/tree/testsuite/samples/books.xhtml" target="_blank">books.xhtml</a> subform.</p>
<p>The main principle behind this subform implementation appears to be the same than for betterFORM but there are some important differences between these two implementations:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">XSLTForms doesn&#8217;t isolate the models from the master form and its subform and it is<br />
possible to access directly to any instance of the master form from the subforms.</li>
<li class="listitem">The features to communicate between models implemented by betterFORM are thus not necessary and do not exist in XSLTForms.</li>
<li class="listitem">The context node is not isolated and is available directly from the controls in the<br />
subform (see the writers/books example for an illustration.</li>
<li class="listitem">A specific action (<code class="code">xf:unload</code>) is used to unload subforms in XSLTForms while an <code class="code">xf:load</code> action with an <code class="code">@show="none"</code> attribute is used in betterFORM for the same purpose.</li>
</ul>
</div>
<p>With these differences, the code developed for betterFORM could be adapted to work with XSLTForms as:</p>
<pre class="brush: xml">&lt;?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?&gt;
&lt;?xsltforms-options debug="yes"?&gt;
&lt;xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events"
   xmlns:xf="http://www.w3.org/2002/xforms"&gt;
   &lt;xh:head&gt;
      &lt;xh:title&gt;Subforms&lt;/xh:title&gt;
      &lt;xf:model id="master"&gt;
         &lt;xf:instance id="main"&gt;
            &lt;figures&gt;
               &lt;rectangle height="10in" width="4em"/&gt;
            &lt;/figures&gt;
         &lt;/xf:instance&gt;

         &lt;!-- Instance used as an "interface" with the subform --&gt;
         &lt;xf:instance id="dimension-interface"&gt;
            &lt;dimension active=""/&gt;
         &lt;/xf:instance&gt;
      &lt;/xf:model&gt;

      &lt;!-- Dirty hack to style controls inline --&gt;
      &lt;xh:style type="text/css"&gt;&lt;![CDATA[

.xforms-group-content, .xforms-group, span.xforms-control, .xforms-label {
   display:inline; 
}

]]&gt;
      &lt;/xh:style&gt;
   &lt;/xh:head&gt;
   &lt;xh:body&gt;
      &lt;xf:group ref="rectangle"&gt;
         &lt;!-- Height --&gt;
         &lt;xf:group ref="@height"&gt;
            &lt;xf:label&gt;Height: &lt;/xf:label&gt;
            &lt;!-- This should be displayed when the subform is not editing the height --&gt;
            &lt;xf:group ref=".[instance('dimension-interface')/@active!='height']"&gt;
               &lt;xf:output ref="."/&gt;
               &lt;!-- Display the trigger when the subform is not loaded anywhere --&gt;
               &lt;xf:trigger ref=".[instance('dimension-interface')/@active = '']"&gt;
                  &lt;xf:label&gt;Edit&lt;/xf:label&gt;
                  &lt;xf:action ev:event="DOMActivate"&gt;
                     &lt;!-- Set the value of the interface instance --&gt;
                     &lt;xf:setvalue ref="instance('dimension-interface')" value="instance('main')/rectangle/@height"/&gt;
                     &lt;!-- Remember that we are editing the height --&gt;
                     &lt;xf:setvalue ref="instance('dimension-interface')/@active"&gt;height&lt;/xf:setvalue&gt;
                     &lt;!-- Load the subform --&gt;
                     &lt;xf:load show="embed" targetid="height" resource="subform-embedded.xml"/&gt;
                  &lt;/xf:action&gt;
               &lt;/xf:trigger&gt;
            &lt;/xf:group&gt;
            &lt;xh:span id="height"/&gt;
            &lt;!-- This should be displayed only when we're editing the height --&gt;
            &lt;xf:group ref=".[instance('dimension-interface')/@active='height']"&gt;
               &lt;xf:trigger&gt;
                  &lt;xf:label&gt;Done&lt;/xf:label&gt;
                  &lt;xf:action ev:event="DOMActivate"&gt;
                     &lt;!-- Copy the value from the interface instance --&gt;
                     &lt;xf:setvalue value="instance('dimension-interface')" ref="instance('main')/rectangle/@height"/&gt;
                     &lt;!-- We're no longer editing any dimension --&gt;
                     &lt;xf:setvalue ref="instance('dimension-interface')/@active"/&gt;
                     &lt;!-- Unload the subform --&gt;
                     &lt;xf:unload targetid="height"/&gt;
                  &lt;/xf:action&gt;
               &lt;/xf:trigger&gt;
            &lt;/xf:group&gt;
         &lt;/xf:group&gt;
         &lt;br/&gt;
         &lt;!-- Width --&gt;
         &lt;xf:group ref="@width"&gt;
            &lt;xf:label&gt;Width: &lt;/xf:label&gt;
            &lt;xf:group ref=".[instance('dimension-interface')/@active!='width']"&gt;
               &lt;xf:output ref="."/&gt;
               &lt;xf:trigger ref=".[instance('dimension-interface')/@active = '']"&gt;
                  &lt;xf:label&gt;Edit&lt;/xf:label&gt;
                  &lt;xf:action ev:event="DOMActivate"&gt;
                     &lt;xf:setvalue ref="instance('dimension-interface')" value="instance('main')/rectangle/@width"/&gt;
                     &lt;xf:setvalue ref="instance('dimension-interface')/@active"&gt;width&lt;/xf:setvalue&gt;
                     &lt;xf:load show="embed" targetid="width" resource="subform-embedded.xml"/&gt;
                  &lt;/xf:action&gt;
               &lt;/xf:trigger&gt;
            &lt;/xf:group&gt;
            &lt;xh:span id="width"/&gt;
            &lt;xf:group ref=".[instance('dimension-interface')/@active='width']"&gt;
               &lt;xf:trigger&gt;
                  &lt;xf:label&gt;Done&lt;/xf:label&gt;
                  &lt;xf:action ev:event="DOMActivate"&gt;
                     &lt;xf:setvalue value="instance('dimension-interface')" ref="instance('main')/rectangle/@width"/&gt;
                     &lt;xf:setvalue ref="instance('dimension-interface')/@active"/&gt;
                     &lt;xf:unload targetid="width"/&gt;
                  &lt;/xf:action&gt;
               &lt;/xf:trigger&gt;
            &lt;/xf:group&gt;
         &lt;/xf:group&gt;
      &lt;/xf:group&gt;
   &lt;/xh:body&gt;
&lt;/xh:html&gt;</pre>
<p>for the main form and:</p>
<pre class="brush: xml">&lt;?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?&gt;
&lt;?xsltforms-options debug="yes"?&gt;
&lt;xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"
   xmlns:ev="http://www.w3.org/2001/xml-events"&gt;
   &lt;xh:head&gt;
      &lt;xh:title&gt;A subform&lt;/xh:title&gt;
      &lt;xf:model id="subform-model"&gt;
         &lt;xf:instance id="split"&gt;
            &lt;height&gt;
               &lt;value/&gt;
               &lt;unit/&gt;
            &lt;/height&gt;
         &lt;/xf:instance&gt;
         &lt;xf:action ev:event="xforms-subform-ready"&gt;
            &lt;xf:setvalue ref="instance('split')/value" value="translate(instance('dimension-interface'), '%incmptxe', '')"/&gt;
            &lt;xf:setvalue ref="instance('split')/unit" value="translate(instance('dimension-interface'), '0123456789', '')"/&gt;
         &lt;/xf:action&gt;
      &lt;/xf:model&gt;
   &lt;/xh:head&gt;
   &lt;xh:body&gt;
      &lt;xf:group ref="instance('split')"&gt;
         &lt;xf:input ref="value"&gt;
            &lt;xf:label/&gt;
            &lt;xf:setvalue ev:event="xforms-value-changed" ref="instance('dimension-interface')" value="concat(instance('split')/value, instance('split')/unit)"/&gt;
         &lt;/xf:input&gt;
         &lt;xf:select1 ref="unit"&gt;
            &lt;xf:label/&gt;
            &lt;xf:setvalue ev:event="xforms-value-changed" ref="instance('dimension-interface')" value="concat(instance('split')/value, instance('split')/unit)"/&gt;
            &lt;xf:item&gt;
               &lt;xf:label&gt;pixels&lt;/xf:label&gt;
               &lt;xf:value&gt;px&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
               &lt;xf:label&gt;font size&lt;/xf:label&gt;
               &lt;xf:value&gt;em&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
               &lt;xf:label&gt;font height&lt;/xf:label&gt;
               &lt;xf:value&gt;ex&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
               &lt;xf:label&gt;inches&lt;/xf:label&gt;
               &lt;xf:value&gt;in&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
               &lt;xf:label&gt;centimeters&lt;/xf:label&gt;
               &lt;xf:value&gt;cm&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
               &lt;xf:label&gt;millimeters&lt;/xf:label&gt;
               &lt;xf:value&gt;mm&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
               &lt;xf:label&gt;points&lt;/xf:label&gt;
               &lt;xf:value&gt;pt&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
               &lt;xf:label&gt;picas&lt;/xf:label&gt;
               &lt;xf:value&gt;pc&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
               &lt;xf:label&gt;%&lt;/xf:label&gt;
               &lt;xf:value&gt;%&lt;/xf:value&gt;
            &lt;/xf:item&gt;
         &lt;/xf:select1&gt;
      &lt;/xf:group&gt;
   &lt;/xh:body&gt;
&lt;/xh:html&gt;</pre>
<p>for the subform.</p>
<p>Acknowledging that things could be easier, XSLTForms has introduced a new experimental feature, derived from subforms, to implement simple components:</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">I have implemented a new component control in XSLTForms. It is named <code class="code">"xf:component</code>&#8221; and has two attributes named &#8220;<code class="code">@ref</code>&#8221; and &#8220;<code class="code">@resource</code>&#8220;. There are still restrictions within a component: ids cannot be used if the component is to be instantiated more than once. The default instance is local to each instantiated component and the <code class="code">subform-instance() </code>function can be used to get the document element of it. From the main form to the component, a binding with a special mip named &#8220;changed&#8221; is defined. The <code class="code">subform-context()</code> allows to reference the node bound to the component control in the main form. The corresponding build has been committed to repositories: <a class="link" href="http://sourceforge.net/p/xsltforms/code/ci/master/tree/build/" target="_blank">http://sourceforge.net/p/xsltforms/code/ci/master/tree/build/</a></td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution"><a class="link" href="http://sourceforge.net/mailarchive/message.php?msg_id=30923296" target="_blank">Alain Couthures on the Xsltforms-support mailing list</a></span></td>
</tr>
</tbody>
</table>
</div>
<p>With this new experimental feature and another extension (the @changed MIP implemented in XSLTForms), the master form would be:</p>
<pre class="brush: xml">&lt;?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?&gt;
&lt;?xsltforms-options debug="yes"?&gt;
&lt;xh:html xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events"
   xmlns:xf="http://www.w3.org/2002/xforms"&gt;
   &lt;xh:head&gt;
      &lt;xh:title&gt;Subforms&lt;/xh:title&gt;
      &lt;xf:model&gt;
         &lt;xf:instance id="main"&gt;
            &lt;figures&gt;
               &lt;rectangle height="10in" width="4em"/&gt;
            &lt;/figures&gt;
         &lt;/xf:instance&gt;

      &lt;/xf:model&gt;
   &lt;/xh:head&gt;
   &lt;xh:body&gt;
      &lt;xf:group ref="rectangle"&gt;
         &lt;!-- Height --&gt;
         &lt;xf:group ref="@height"&gt;
            &lt;xf:label&gt;Height: &lt;/xf:label&gt;
            &lt;xf:component ref="." resource="component-subform.xml"/&gt;
         &lt;/xf:group&gt;
         &lt;br/&gt;
         &lt;!-- Width --&gt;
         &lt;xf:group ref="@width"&gt;
            &lt;xf:label&gt;Width: &lt;/xf:label&gt;
            &lt;xf:component ref="." resource="component-subform.xml"/&gt;
         &lt;/xf:group&gt;
      &lt;/xf:group&gt;
   &lt;/xh:body&gt;
&lt;/xh:html&gt;</pre>
<p>and the subform (or component):</p>
<pre class="brush: xml">&lt;?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?&gt;
&lt;xh:html xmlns:xh="http://www.w3.org/1999/xhtml" 
    xmlns:xf="http://www.w3.org/2002/xforms" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:ev="http://www.w3.org/2001/xml-events"&gt;
    &lt;xh:head&gt;
        &lt;xh:title&gt;Size&lt;/xh:title&gt;
        &lt;xf:model&gt;
            &lt;xf:instance&gt;
                &lt;size&gt;
                    &lt;value xsi:type="xsd:decimal"&gt;2&lt;/value&gt;
                    &lt;unit&gt;cm&lt;/unit&gt;
                &lt;/size&gt;
            &lt;/xf:instance&gt;
            &lt;xf:bind ref="subform-instance()/value" 
                changed="translate(subform-context(), '%incmptxe', '')"/&gt;
            &lt;xf:bind ref="subform-instance()/unit" 
                changed="translate(subform-context(), '0123456789', '')"/&gt;
        &lt;/xf:model&gt;
    &lt;/xh:head&gt;
    &lt;xh:body&gt;
        &lt;xf:input ref="subform-instance()/value"&gt;
            &lt;xf:label/&gt;
            &lt;xf:setvalue ev:event="xforms-value-changed" 
                ref="subform-context()" value="concat(subform-instance()/value, 
                subform-instance()/unit)"/&gt;
        &lt;/xf:input&gt;
        &lt;xf:select1 ref="subform-instance()/unit"&gt;
            &lt;xf:label/&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;pixels&lt;/xf:label&gt;
                &lt;xf:value&gt;px&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;font size&lt;/xf:label&gt;
                &lt;xf:value&gt;em&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;font height&lt;/xf:label&gt;
                &lt;xf:value&gt;ex&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;inches&lt;/xf:label&gt;
                &lt;xf:value&gt;in&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;centimeters&lt;/xf:label&gt;
                &lt;xf:value&gt;cm&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;millimeters&lt;/xf:label&gt;
                &lt;xf:value&gt;mm&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;points&lt;/xf:label&gt;
                &lt;xf:value&gt;pt&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;picas&lt;/xf:label&gt;
                &lt;xf:value&gt;pc&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:item&gt;
                &lt;xf:label&gt;%&lt;/xf:label&gt;
                &lt;xf:value&gt;%&lt;/xf:value&gt;
            &lt;/xf:item&gt;
            &lt;xf:setvalue ev:event="xforms-value-changed" 
                ref="subform-context()" value="concat(subform-instance()/value, 
                subform-instance()/unit)"/&gt;
        &lt;/xf:select1&gt;
    &lt;/xh:body&gt;
&lt;/xh:html&gt;</pre>
<p>The level of complexity of both the definition of the subform component and its invocation are similar to what we&#8217;ve seen with Orbeon&#8217;s XBL feature. The main difference is the encapsulation (no encapsulation in XSLTForms and a controlled encapsulation in Orbeon Forms which handles the issue of id collisions).</p>
<p>Note that we are escaping the issue caused by id collision because we are accessing the instance from the master form directly from the subform using the <code class="code">subform-context()</code> function.</p>
<p>This feature allows us to use only one local instance in the subform and we take care of not defining any id for this instance and access it using the <code class="code">subform-instance()</code> function.<br />
This trick wouldn&#8217;t work if we needed several instances or if we had to define ids on other elements in the subform.</p>
</div>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e307"></a>Conclusion</h2>
</div>
</div>
</div>
<p>The lack of modularity has been one of the serious weaknesses in the XForms recommendations so far.</p>
<p>A common solution is to generate or &#8220;template&#8221; XForms but this can be tricky when dealing with &#8220;components&#8221; used multiple times in a form and especially within <code class="code">xf:repeat</code> controls.</p>
<p>Different implementation have come up with different solutions to address this issue (XBL for Orbeon, subforms for betterFORM and XSLTForms).</p>
<p>The main differences between these solutions are:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">The syntax:
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle;">
<li class="listitem">XBL + XForms for Orbeon Forms</li>
<li class="listitem">XForms with minor extensions for betterFORM and XSLTForms)</li>
</ul>
</div>
</li>
<li class="listitem">The encapsulation or isolation and features to communicate between the component and other models:
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle;">
<li class="listitem">complete for betterFORM with extensions to communicate between models</li>
<li class="listitem">either complete or partial for Orbeon Forms with extension to communicate between models</li>
<li class="listitem">no isolation for XSLTForms with extensions to access to the context node and default instance from a component</li>
</ul>
</div>
</li>
<li class="listitem">The support of id collisions between components and the main form:
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle;">
<li class="listitem">Id collisions are handled by Orbeon Forms</li>
<li class="listitem">They are forbidden by betterFORM and XSLTForms</li>
</ul>
</div>
</li>
</ul>
</div>
<p>The lack of interoperability between these implementations will probably not be addressed by the W3C XForms Working Group and it would be very useful if XForms implementers could work together to define interoperable solutions to define reusable components in XForms.</p>
<p>In this paper, generation (or templating) has been presented as an alternative to XML or subforms but they are by no mean exclusive. In real world projects, hybrid approaches mixing XForms generation (or templating) and components (XBL or subforms) are on the contrary very valuable. They have been demonstrated in a number of talks during the pre-conference day at XML Prague.</p>
<p>These hybrid approaches are easy to implement with common XML toolkits. The generation/templating can be static (using tools such as XProc, Ant or classical make files) or dynamic (using XProc or XPL pipelines or plain XQuery or XSLT) and Orbeon Forms XBL implementation even provides <a class="link" href="http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide#TOC-xbl:template-xxbl:transform-attribute" target="_blank">a feature</a> to dynamically invoke a transformation on the content of the bound element).</p>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e342"></a>Acknowledgments</h3>
</div>
</div>
</div>
<p>I would like to thank Erik Bruchez (Orbeon), Joern Turner (betterFORM) and Alain Couthures (XSLTForms) for the time they&#8217;ve spent to answer my questions and review this paper.</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2013/06/17/when-mvc-becomes-a-burden-for-xforms-xml-london-2013/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ittoqqortoormiit</title>
		<link>http://eric.van-der-vlist.com/blog/2013/04/25/ittoqqortoormiit/</link>
		<comments>http://eric.van-der-vlist.com/blog/2013/04/25/ittoqqortoormiit/#comments</comments>
		<pubDate>Thu, 25 Apr 2013 19:13:44 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[Environnement]]></category>
		<category><![CDATA[Français]]></category>
		<category><![CDATA[Personnel/Personal]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[écologie]]></category>
		<category><![CDATA[gaz de schiste]]></category>
		<category><![CDATA[hydrocarbures]]></category>
		<category><![CDATA[ittoqqortoormiit]]></category>
		<category><![CDATA[réchauffement climatique]]></category>
		<category><![CDATA[science fiction]]></category>
		<category><![CDATA[suicide collectif]]></category>
		<category><![CDATA[technicologie]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=790</guid>
		<description><![CDATA[Ittoqqortoormiit, Juillet 2058 La Gazette d&#8217;Ittoqqortoormiit : Professeur Sean Lafontaine, vous êtes responsable du laboratoire de technicologie de l&#8217;université d&#8217;Ittoqqortoormiit. Pouvez vous nous expliquer en quoi consiste votre activité et quelles sont ses particularités ? Sean Lafontaine : La technicologie est la branche &#8230; <a href="http://eric.van-der-vlist.com/blog/2013/04/25/ittoqqortoormiit/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<style type="text/css"><!--
P { margin-bottom: 0.21cm; }A:link {  }
--></style>
<p>Ittoqqortoormiit, Juillet 2058</p>
<p>La Gazette d&#8217;Ittoqqortoormiit : Professeur Sean Lafontaine, vous êtes responsable du laboratoire de technicologie de l&#8217;université d&#8217;<a href="http://fr.wikipedia.org/wiki/Ittoqqortoormiit">Ittoqqortoormiit</a>. Pouvez vous nous expliquer en quoi consiste votre activité et quelles sont ses particularités ?</p>
<p>Sean Lafontaine : La technicologie est la branche de l&#8217;<a href="http://fr.wikipedia.org/wiki/Archéologie">archéologie</a> consacrée à la <a href="http://fr.wikipedia.org/wiki/Le_système_technicien">civilisation technicienne</a>. Bien que cette civilisation soit beaucoup plus récente que celles qui sont étudiées par les autres branches de l&#8217;archéologie les matériaux disponibles posent de tels problèmes d&#8217;interprétation qu&#8217;une véritable approche scientifique de type archéologique est nécessaire.</p>
<p>LGI : Quel type de problèmes ?</p>
<p>SL : À la fin du siècle dernier cette civilisation a amorcé un processus de « <a href="http://fr.wikipedia.org/wiki/Dématérialisation">dématérialisation</a> » de sa production intellectuelle. Cette dématérialisation se traduisait par un stockage dit « électronique » des documents (écrits, photos, sons, films, …). Les technologies employées pour ce stockage étaient variées mais dans tous les cas il était nécessaire de disposer de compétences technologiques et d&#8217;énergie électrique pour accéder aux informations « dématérialisées ».</p>
<p>LGI : Autant dire en effet que l&#8217;accès à ces ressources est désormais réservé à des spécialistes ! Comment faites vous pour résoudre ces problèmes ?</p>
<p>SL : Notre laboratoire a l&#8217;autorisation de produire, de manière strictement contrôlée bien entendu, l&#8217;énergie électrique dont il a besoin pour poursuivre ses recherches. En ce qui concerne les connaissances technologiques, c&#8217;est une discipline à part entière, au même titre que la <a href="http://fr.wikipedia.org/wiki/Sigillographie">sigillographie</a> ou l&#8217;<a href="http://fr.wikipedia.org/wiki/Épigraphie">épigraphie</a> pour prendre deux exemples plus connus. En technicologie nous avons la chance de pouvoir nous appuyer sur des témoins vivants ayant utilisé ces technologies. Ces survivants sont peu nombreux mais leurs témoignages ont été précieux pour établir les bases de notre discipline.</p>
<p>LGI : Parlez nous de cette mystérieuse boîte noire découverte le mois dernier&#8230;</p>
<p>SL : Nous avons découvert une <a href="http://www.fit-pc.com/web/fit-pc/fit-pc2i-specifications/">petite boîte parallélépipédique</a>, de 101 mm de largeur, 115 mm de longueur et 27 mm d&#8217;épaisseur, pesant moins de 400g dans une ruine située en zone rurale au nord ouest de la diagonale sèche. Cette boîte métallique portait des signes suggérant une utilisation de type « dématérialisation ».</p>
<p>LGI : Pouvez vous préciser quels sont ces signes pour que nos lecteurs puissent vous alerter s&#8217;ils trouvaient des objets de ce type ?</p>
<p>SL : Les zones que nous habitons maintenant étaient quasiment désertes avant le changement climatique et il est peu probable d&#8217;y trouver de tels objets, mais il peut tout de même être utile que vos lecteurs sachent reconnaître ces objets&#8230; Leur formes et leur dimensions sont très variées et la manière la plus fiable de les identifier est la présence de « <a href="http://fr.wikipedia.org/wiki/Connectique">connecteurs</a> » . Les connecteurs sont de petits trous souvent rectangles ou ronds et dans lesquels on distingue parfois des éléments en cuivre.</p>
<p>LGI : Merci professeur. Je peux maintenant vous poser la question qui me brûle les lèvres&#8230; Cette boîte noire livrera t-elle ses secrets ?</p>
<p>SL : Oui, et ils sont fabuleux ! Hier notre équipe a enfin réussi à la faire parler. Il nous faudra plusieurs mois pour exploiter les documents qui nous sont dévoilés. Nous avons déjà identifié plus de 100 000 lettres électroniques, 50 000 photos, plusieurs heures de films mais ce n&#8217;est qu&#8217;une infime partie du contenu de la boîte et il y a beaucoup documents dont nous ne comprenons pas encore la nature.</p>
<p>LGI : Autant de documents dans un si faible volume !</p>
<p>SL : Oui, nous estimons que l&#8217;on pouvait stocker plus de <a href="http://fr.wikipedia.org/wiki/Terabyte">mille milliards de caractères</a> dans cette boîte.</p>
<p>LGI : Les prouesses techniques de cette civilisation sont vraiment surprenantes, quel dommage qu&#8217;elle n&#8217;ai pas su maîtriser les utilisations de ses technologies !</p>
<p>SL : L&#8217;<a href="http://fr.wikipedia.org/wiki/Historien">historien</a> que je suis se garde bien de porter un jugement de valeur sur l&#8217;objet de ses recherches, mais je dois avouer que je suis effectivement souvent surpris par les performances des objets que j&#8217;étudie.</p>
<p>LGI : Pour obtenir de telles prouesses, cette boîte noire devait produire beaucoup de <a href="http://fr.wikipedia.org/wiki/Dioxyde_de_carbone">CO</a><a href="http://fr.wikipedia.org/wiki/Dioxyde_de_carbone"><sub>2</sub></a> !</p>
<p>SL : Pas de manière directe, non. Nos mesures montrent qu&#8217;elle consomme moins de 10W, ce qui représente, même avec un mode de production d&#8217;électricité à forte émission en CO<sub>2</sub>, moins de 250 g de CO<sub>2</sub> par jour (quatre fois moins que la respiration humaine). Par contre pour être utile cette boîte a besoin d&#8217;être connectée à un ensemble d&#8217;équipements (pour visualiser les informations, les échanger avec d&#8217;autres machines, …). Si l&#8217;on considère l&#8217;ensemble de ces équipements, la production de CO<sub>2</sub> est considérable.</p>
<p>LGI : Sait on à quoi servait cette boîte noire ?</p>
<p>SL : Nous pensons qu&#8217;elle servait d&#8217;archive. Les données matérialisées devaient être dupliquées et entreposées dans plusieurs équipements pour survivre à la destruction de l&#8217;un d&#8217;entre eux.</p>
<p>LGI : Dans ce cas, c&#8217;est un peu comme les livres dont la pérennité est assurée par la dissémination ! Que faisait cette boîte dans une zone rurale ?</p>
<p>SL : Nous pensons que son propriétaire avait deux résidences, une en ville et une à la campagne et qu&#8217;il avait des archives dans chacune de ses résidences.</p>
<p>LGI : Malin&#8230; Mais vous avez donc pu identifier son propriétaire ?</p>
<p>SL : Il s&#8217;appelait <a href="http://fr.wikipedia.org/wiki/Eric_van_der_vlist">Éric van der Vlist</a> et nous cherchons à cerner ses habitudes et sa personnalité.</p>
<p>LGI : Vous avez donc suffisamment d&#8217;informations pour cela ?</p>
<p>SL : Oui, nous avons retrouvé beaucoup de messages dont certains sont très personnels ainsi que des photos.</p>
<p>LGI : Quel était son métier ?</p>
<p>SL : Il travaillait dans le domaine de la dématérialisation de l&#8217;information. Les machines avaient pris une telle importance que les documents étaient écrits de manière à être compréhensibles par les machines avant de l&#8217;être par l&#8217;homme ce qui complique d&#8217;ailleurs notablement leur compréhension. Pour cela il existait plusieurs vocabulaires concurrents. Eric van der Vlist était spécialiste d&#8217;un de ces vocabulaires appelé <a href="http://fr.wikipedia.org/wiki/Xml">XML</a>. Son <a href="http://dyomedea.com/">activité professionnelle principale</a> était de conseiller des entreprises dans l&#8217;utilisation de ce vocabulaire. C&#8217;était un expert reconnu et il se déplaçait en avion pour rencontrer ses pairs lors de grandes réunions appelées <a href="http://fr.wikipedia.org/wiki/Conférence">conférences</a>.</p>
<p>LGI : En avion ? Pour un motif aussi futile ? Il n&#8217;avait donc aucune conscience des <a href="http://fr.wikipedia.org/wiki/Avion#.C3.89missions_de_CO2">enjeux environnementaux</a> ?</p>
<p>SL : Effectivement, il faisait chaque année un voyage à <a href="http://balisage.net/">Montréal</a> (1400 kg de CO<sub>2</sub>) et un à <a href="http://www.xmlprague.cz/">Prague</a> (300 kg de CO<sub>2</sub>) mais c&#8217;était une pratique courante à l&#8217;époque et ces réunions regroupaient des centaines de personnes. Pour en revenir à votre question, ce qui rend notre découverte particulièrement intéressante, c&#8217;est que contrairement à ce que vous pouvez penser, Eric avait un niveau de conscience des enjeux environnementaux plutôt élevé par rapport à ses contemporains.</p>
<p>LGI: Ce niveau de conscience ne le rend il pas d&#8217;autant plus coupable ?</p>
<p>SL : Mon activité est une activité d&#8217;historien et il ne m&#8217;appartient pas de juger les comportements. Par contre l&#8217;étude de sa personnalité peut nous aider à comprendre pourquoi cette civilisation a été incapable de stopper et même de freiner la <a href="http://fr.wikipedia.org/wiki/Réchauffement_climatique">catastrophe écologique</a> qu&#8217;elle alimentait et dont elle avait conscience.</p>
<p>LGI : Et ce van der Vlist vous semble donc un sujet intéressant de ce point de vue ?</p>
<p>SL : Indéniablement. Notamment parce qu&#8217;il est né en <a href="http://fr.wikipedia.org/wiki/1958">1958</a>, au moment charnière où la civilisation technicienne a semblé perdre le contrôle de sa propre évolution. Sa vie coïncide avec le dernier acte de cette civilisation.</p>
<p>LGI : Si je comprend bien, c&#8217;est un témoin privilégié de la chute de la civilisation technicienne.</p>
<p>SL : Oui, mais malheureusement il semble avoir laissé peu de textes liés à l&#8217;environnement et son journal contient surtout des textes liés à son activité technicienne.</p>
<p>LGI : Comment savez vous qu&#8217;il avait conscience des enjeux environnementaux ?</p>
<p>SL :Il a tout de même laissé quelques textes sur ce thème ainsi qu&#8217;une <a href="http://eric.van-der-vlist.com/blog/2008/12/16/un-demi-siecle/">courte auto biographie</a> écrite à l&#8217;occasion de ses cinquante ans. Il y explique notamment qu&#8217;il a été impliqué dès <a href="http://fr.wikipedia.org/wiki/1981">1981</a> à un programme de mesure du taux de CO<sub>2</sub> dans l&#8217;atmosphère et qu&#8217;il a pris conscience des risques de réchauffement climatique dès cette période.</p>
<p>LGI:Le milieu scientifique était donc au courant dès 1981 ?</p>
<p>SL : Bien entendu. Si nous disposons de peu de documents de la période de dématérialisation massive, nous avons paradoxalement beaucoup plus de documents des périodes plus anciennes et nous avons retrouvé des travaux datant de <a href="http://fr.wikipedia.org/wiki/1895">1895</a> établissant un lien entre la température moyenne sur notre planète et la concentration en C0<sub>2</sub> de son atmosphère.</p>
<p>LGI:1895 ? Vous voulez dire 1985 ?</p>
<p>SL : Non, c&#8217;est bien à la fin du dix neuvième siècle, en 1895 que ces travaux ont été publiés. Ils sont probablement passés quelque peu inaperçus et ce ne sont pas ces travaux qui ont valu son prix Nobel de Chimie à <a href="http://fr.wikipedia.org/wiki/Svante_Arrhenius">Svante Arrhenius</a>.</p>
<p>LGI: Nos prédécesseurs connaissaient donc parfaitement les risques qu&#8217;ils courraient ?</p>
<p>SL : Dans les milieux scientifiques concernés, incontestablement. Il faudra pourtant attendre <a href="http://fr.wikipedia.org/wiki/2001">2001</a> et le rapport du <a href="http://fr.wikipedia.org/wiki/GIEC">GIEC</a> pour que ce sujet soit réellement porté à l&#8217;attention du grand public.</p>
<p>LGI : 2001 ! Que de temps perdu ! Plus d&#8217;un siècle après la découverte de l&#8217;influence de l&#8217;<a href="http://fr.wikipedia.org/wiki/Effet_de_serre">effet de serre sur le climat</a> ! Vingt ans après que ce van der Vlist ait fait ses mesures de CO<sub>2</sub> ! Qu&#8217;a t-il fait pendant ces vingt années pour prévenir ses contemporains ?</p>
<p>SL : Il explique dans son autobiographie qu&#8217;il a hésité mais qu&#8217;il a abandonné sa carrière de chercheur pour une activité technique mieux rémunérée. Il s&#8217;est également marié et au eu quatre enfants.</p>
<p>LGI : Quatre enfants ! N&#8217;avait il pas conscience du niveau de <a href="http://fr.wikipedia.org/wiki/Population_mondiale">surpopulation</a> de l&#8217;époque ? Combien d&#8217;habitants comptait notre planète à ce moment ?</p>
<p>SL : Environ cinq milliards et demi lorsqu&#8217;ils ont eu leur dernier enfant. Pour comprendre son comportement, il faut savoir que le monde était divisé en « <a href="http://fr.wikipedia.org/wiki/Pays">pays</a> » qui se concurrençaient. Eric vivait dans un <a href="http://fr.wikipedia.org/wiki/France">pays à la population vieillissante</a> qui <a href="http://fr.wikipedia.org/wiki/Politique_familiale">encourageait les naissances</a> pour conserver un niveau de population stable.</p>
<p>LGI : Eric van der Vlist fait donc des mesures de CO<sub>2</sub> et prend conscience des risques de réchauffement climatique en 1981 sans que cela ne change son comportement ? C&#8217;est invraisemblable !</p>
<p>SL : Son comportement a été influencé par cette prise de conscience mais dans des proportions qui sont restées limitées.</p>
<p>LGI : Que faisait-il ?</p>
<p>SL : Quand il a quitté <a href="http://fr.wikipedia.org/wiki/Cnrs">institut de recherche</a> où il travaillait sur le CO<sub>2</sub>, il a rejoint <a href="http://amitrtlu.free.fr/guirimand/">une société</a> pour travailler dans le domaine de la téléphonie mobile.</p>
<p>LGI : Une société ? Vous voulez dire qu&#8217;avant cela il était resté en marge de la société ?</p>
<p>SL : Non, les techniciens étaient organisés en groupements appelés « <a href="http://fr.wikipedia.org/wiki/Entreprise">sociétés</a> » ou « <a href="http://fr.wikipedia.org/wiki/Personne_morale">personnes </a><a href="http://fr.wikipedia.org/wiki/Personne_morale">morales</a> » dont le but était de grossir et de gagner de l&#8217;argent et Eric a rejoint un de ces groupements.</p>
<p>LGI: Ces sociétés devaient être soumises à des impératifs moraux très forts pour mériter le nom de personne morale !</p>
<p>SL : Au contraire&#8230; Elles échappaient à tous les principes moraux ou religieux et leurs seules règles étaient d&#8217;obéir aux lois en vigueur et de gagner plus d&#8217;argent qu&#8217;elles n&#8217;en dépensaient.</p>
<p>LGI : Pouvez vous nous expliquer ce qu&#8217;était la <a href="http://fr.wikipedia.org/wiki/Téléphonie_mobile">téléphonie mobile</a> ?</p>
<p>SL : Les techniciens avaient développé un besoin irraisonné de rester « connectés » les uns aux autres par l&#8217;intermédiaire de téléphones mobiles, qui étaient des petits boîtiers transmettant sons et images au moyen d&#8217;<a href="http://fr.wikipedia.org/wiki/Onde_électromagnétique">ondes électromagnétiques</a> et fonctionnant à l&#8217;électricité.</p>
<p>LGI : Encore l&#8217;<a href="http://fr.wikipedia.org/wiki/Électricité">électricité</a>&#8230; Ce besoin de se sentir connecté me semble être une curieuse manie ! Eric van der Vlist en était donc à la fois un des initiateurs et un adepte ?</p>
<p>SL : Avant d&#8217;en <a href="http://eric.van-der-vlist.com/blog/2011/02/13/sans-fil/">souligner les effets pervers</a>, oui. Mais il ne faut pas exagérer son rôle dans le développement de cette technologie. Il a en effet changé de domaine d&#8217;activité alors qu&#8217;elle était encore balbutiante.</p>
<p>LGI : Il a donc rapidement perçu le caractère pathologique de ce type de comportement ?</p>
<p>SL : Non, son texte sur les effets pervers du téléphone mobile est assez tardif et date de <a href="http://en.wikipedia.org/wiki/2011">2011</a>. Il a changé de domaine d&#8217;activité parce que le téléphone mobile était développé par des sociétés <a href="http://fr.wikipedia.org/wiki/Multinationale">multinationales</a> de taille importante dans lesquelles il ne se sentait pas à l&#8217;aise.</p>
<p>LGI : Vous nous avez expliqué que le but de ces sociétés était de grossir, les grosses sociétés devaient donc être les meilleures d&#8217;entre elles, pourquoi vouloir en partir ?</p>
<p>SL : La plupart des sociétés étaient des structures très hiérarchisées dans lesquelles l&#8217;initiative personnelle n&#8217;était pas encouragée et dans lesquelles la compétition était fortement encouragée.</p>
<p>LGI : Je pensais que la civilisation technicienne était organisée suivant des principes démocratiques, ce n&#8217;était pas le cas ?</p>
<p>SL : Certains pays étaient gouvernés suivant des principes démocratiques mais les sociétés n&#8217;étaient pas soumises à cette règle.</p>
<p>LGI : Votre homme a t-il pu échapper à leur contrôle ?</p>
<p>SL : Il a travaillé dans des sociétés de plus en plus petites avant créer une société uni-personnelle pour vendre le résultat de son travail. C&#8217;est à ce moment qu&#8217;il s&#8217;est spécialisé dans ce XML qui permettait d&#8217;écrire des textes compréhensibles par les machines.</p>
<p>LGI : Pourquoi ce choix ?</p>
<p>SL : Je suppose que cela devait correspondre à un sujet en vogue à cette époque. Il faut également dire que c&#8217;était un sujet « <a href="http://fr.wikipedia.org/wiki/Format_ouvert">ouvert</a> » dans lequel les contributions de petites structures indépendantes étaient bienvenues.</p>
<p>LGI : Il n&#8217;avait pas conscience de la fragilité des documents dématérialisés ?</p>
<p>SL : Si et il a même lancé un <a href="http://owark.org/">projet</a> d&#8217;<a href="http://fr.wikipedia.org/wiki/Archivage_électronique">archivage</a> de ces documents. Malheureusement, les archives étaient elles aussi dématérialisées ce qui réduit leur pérennité.</p>
<p>LGI : Je dirais même que ça les rend inutiles, non ?</p>
<p>SL : Non, pas totalement. La boite que nous venons de retrouver contient à la fois les textes d&#8217;Eric van der Vlist mais également les archives des documents auxquels il faisait référence ce qui s&#8217;avère très précieux à leur compréhension.</p>
<p>LGI : En tout cas, je ne vois pas ce qui évoque une conscience des problèmes environnementaux dans tout cela !</p>
<p>SL : En <a href="http://fr.wikipedia.org/wiki/1994">1994</a> il acheté la ferme dans laquelle nous avons retrouvé la boîte noire et a tenté de vivre plus proche de la nature et de réduire son <a href="http://fr.wikipedia.org/wiki/Empreinte_écologique">empreinte écologique</a>.</p>
<p>LGI : Ce n&#8217;était pas trop tôt pour s’apercevoir qu&#8217;il fallait changer de vie !</p>
<p>SL : Non, mais ce changement a été partiel et il a commencé à mener une double vie : la semaine en ville consacrée à des activités techniques et les samedi et dimanche à la campagne à cultiver son jardin.</p>
<p>LGI : J&#8217;espère qu&#8217;il essayait au moins de minimiser le <a href="http://fr.wikipedia.org/wiki/Bilan_carbone">bilan carbone</a> de ses transhumances hebdomadaires !</p>
<p>SL : Il n&#8217;en dit pas grand chose. D&#8217;après <a href="http://www.moteurnature.com/actu/uneactu.php?news_id=25749">nos recherches</a>, il utilisait un véhicule appelé « <a href="http://fr.wikipedia.org/wiki/Renault_Espace#Espace_II">Renault Espace</a> » qui rejetait près de 200g de CO<sub>2</sub> par kilomètre et parcourait environ 350 km par semaine, soit 3500 kg de CO<sub>2</sub> par an&#8230;</p>
<p>LGI : Et à part cela ?</p>
<p>SL : En <a href="http://fr.wikipedia.org/wiki/2007">2007</a> et surtout en <a href="http://fr.wikipedia.org/wiki/2008">2008</a> il a étendu son activité agricole en achetant un nouveau terrain et en plantant des arbres fruitiers. Il privilégié les variétés anciennes menacées de disparition à court terme. Il a également introduit des <a href="http://fr.wikipedia.org/wiki/Ouessant_(race_ovine)">moutons</a> et des <a href="http://oiedebavent.blogspot.fr/">oies</a> de races à faible effectif pour entretenir ses terrains.</p>
<p>LGI : Cela aurait sans doute été très utile s&#8217;il s&#8217;était également préoccupé d&#8217;atténuer le changement climatique qui allait détruire ces arbres et ces animaux. Est-ce que ses arbres compensait ses émissions de CO<sub>2</sub> ?</p>
<p>SL : Non. Il a planté 400 arbres pouvant capter chacun 5kg de CO<sub>2</sub>, cela ne fait guère que 2000 kg de CO<sub>2</sub> par an, ce qui couvre juste 1700 kg de voyages en avion..</p>
<p>LGI : Son engagement s&#8217;arrêtait là ?</p>
<p>SL : Il a aussi aidé sa femme <a href="http://fr.wikipedia.org/wiki/Catherine_chalom">Catherine</a> à créer <a href="http://leretouralaterre.fr/accueil/qui-sommes-nous/magasins/">deux magasins</a> de produits dits « <a href="http://fr.wikipedia.org/wiki/Agriculture_biologique">biologiques</a> » cultivés et produits sans produits chimiques et avec un impact réduit sur l&#8217;environnement. Ces magasins appelés « le Retour à la Terre » essayaient de sensibiliser leurs clients et organisaient des réunions pour débattre de thèmes liés à l&#8217;environnement.</p>
<p>LGI : Tout cela semble ridiculement insuffisant ! On a l&#8217;impression d&#8217;une erreur d&#8217;analyse : ses archives sont dématérialisées sans qu&#8217;il ne s&#8217;interroge sur la pérennité des ressources électriques qui leur sont nécessaires de la même manière qu&#8217;il veut sauvegarder des espèces animales et végétales sans s&#8217;interroger sur la pérennité de leur écosystème dans son ensemble.</p>
<p>SL : Vous avez mis le doigt sur le cœur du problème et c&#8217;est ce que nous aimerions comprendre !</p>
<p>LGI : N&#8217;a t-il pas laissé d&#8217;indications à ce sujet ?</p>
<p>SL : Si, mais dans un texte difficile à analyser.</p>
<p>LGI : Que voulez vous dire ?</p>
<p>SL : Début <a href="http://fr.wikipedia.org/wiki/2013">2013</a>, il a écrit un texte atypique, présenté comme une fiction dans lequel il imaginait qu&#8217;on retrouve ses écrits après une catastrophe environnementale majeure.</p>
<p>LGI : Tient donc, il avait donc conscience du risque ! Et pourquoi ce texte est-il difficile à interpréter ?</p>
<p>SL : Comment distinguer la fiction du réel ?</p>
<p>LGI : Essayons tout de même ! Sait on ce qui a pu se passer début 2013 pour le pousser à écrire cette « fiction » ?</p>
<p>SL : Au tout début du vingt-et-unième siècle on a pu espérer que la <a href="http://fr.wikipedia.org/wiki/Pic_pétrolier">raréfaction des ressources </a><a href="http://fr.wikipedia.org/wiki/Pic_pétrolier">pétrolières</a> allait contraindre la civilisation technicienne à limiter de manière drastique sa consommation d&#8217;hydrocarbures et donc sa génération de gaz à effet de serre.</p>
<p>LGI : Et c&#8217;est en 2013 qu&#8217;on s’est aperçu que ce ne serait pas le cas ?</p>
<p>SL : En tout cas, c&#8217;est fin 2012 qu’Éric van der Vlist semble en avoir pris conscience.</p>
<p>LGI : Que c&#8217;est il passé ?</p>
<p>SL : Il devenait de plus en plus évident que la civilisation technicienne allait régler, à son habitude, la raréfaction des ressources en hydrocarbures de manière purement technique sans se soucier des conséquences de cette décision.</p>
<p>LGI : Comment cela ? Quand il n&#8217;y a plus d&#8217;hydrocarbures il n&#8217;y en a plus !</p>
<p>SL : Sauf si on va chercher la moindre goutte là où elle se trouve quelque soient les conséquences. Seuls les gisements relativement faciles à exploiter l&#8217;avaient été et les techniciens ont développé des technologies permettant d&#8217;exploiter des gisements de gaz et de pétrole plus difficiles à exploiter et qualifiés de <a href="http://fr.wikipedia.org/wiki/Pétrole_non_conventionnel">non conventionnels</a>.</p>
<p>LGI : C&#8217;était possible ?</p>
<p>SL : Quand on est prêt à extraire du pétrole en forant le sol à plus de 1500 m sous le niveau de la mer à partir d&#8217;<a href="http://fr.wikipedia.org/wiki/Plate-forme_pétrolière">énormes radeaux</a> ou à <a href="http://www.radio-canada.ca/nouvelles/Economie/2011/06/01/010-gaz-schiste-seisme.shtml">fracturer les roches jusqu&#8217;à provoquer des séismes</a> il est toujours possible se trouver des hydrocarbures.</p>
<p>LGI : Ils étaient donc prêts à prendre tous les risques pour prolonger un mode de vie favorisant la production de gaz à effet de serre ?</p>
<p>SL : J&#8217;en ai bien l&#8217;impression, oui.</p>
<p>LGI : Eric van der Vlist était il isolé dans sa prise de conscience ?</p>
<p>SL : Pas vraiment. L’imminence d&#8217;un changement climatique était même assez généralement admise dans les pays européens.</p>
<p>LGI : Si c&#8217;est le cas, vu l&#8217;importance des enjeux, les hommes et femmes conscients de cette catastrophe imminente n&#8217;avaient ils pas de moyens d&#8217;actions plus efficaces ?</p>
<p>SL : Beaucoup de gens se sentaient impuissants à faire changer les choses.</p>
<p>LGI : Leur société n&#8217;était elle pas organisée de manière démocratique ?</p>
<p>SL : De nombreux pays étaient effectivement régis suivant des principes démocratiques, mais leur mode d&#8217;organisation ne semble pas lui avoir permis de prendre les mesures nécessaires.</p>
<p>LGI : Pourquoi ?</p>
<p>SL : C&#8217;est un sujet complexe sur lequel nous ne pouvons émettre que des hypothèses.</p>
<p>LGI : Lesquelles ?</p>
<p>SL : Les « sociétés » dont le seul but était de gagner de l&#8217;argent dont nous avons déjà parlé ont indéniablement été un des facteurs. Leur développement était tel qu&#8217;elles étaient devenues de véritables contre pouvoirs. Les plus grosses d&#8217;entre elles étaient « <a href="http://fr.wikipedia.org/wiki/Multinationale">multinationales</a> » et étendaient leur champ d&#8217;action sur toute la planète. Leur développement reposait sur la croissance de l&#8217;économie elle même liée à l&#8217;utilisation de ressources non renouvelables entraînant la production de gaz à effet de serre. Leur importance leur permettait d’exercer des pressions sur toutes les structures scientifiques et politiques et de bloquer les décisions qui leur étaient défavorables.</p>
<p>LGI : Les structures démocratiques ne donnaient elles pas suffisamment de pouvoir aux peuples pour contrer cela ?</p>
<p>SL : Si, mais à condition qu&#8217;ils soient correctement informés et que les choix qui leur soient présentés soient réellement ouverts.</p>
<p>LGI : Correctement informés ?</p>
<p>SL : Les sociétés contrôlaient partiellement la recherche scientifique et alimentaient des études dont le but étaient de brouiller les cartes en niant les effets de certains développements technologiques et parfois même la réalité de l&#8217;effet de serre et du réchauffement climatique.</p>
<p>LGI : Vous laissez entendre que les options proposées aux peuples n&#8217;étaient pas vraiment ouvertes, pourquoi ?</p>
<p>SL : Le pouvoir politique était exercé par une caste de professionnels dont un des buts était de se maintenir au pouvoir. Étant élus, ils ne pouvaient pas se permettre de prendre des décisions impopulaires et ceux d&#8217;entre eux qui remettaient en cause la poursuite de la «<a href="http://fr.wikipedia.org/wiki/Croissance_économique"> croissance </a>» économique, nécessairement plus ou moins liée à une croissance des gaz à effet de serre étaient considérés comme des <a href="http://fr.wikipedia.org/wiki/Mouvement_Utopia">utopistes</a> et leurs propositions écartées d&#8217;office.</p>
<p>LGI : Cette société est donc sciemment allé à la catastrophe pour pouvoir continuer à sur-exploiter la planète, cela semble hallucinant !</p>
<p>SL : C&#8217;est difficile à comprendre mais les faits sont pourtant là.</p>
<p>LGI : Merci Professeur. Je rappelle que cette semaine nous recevions le Professeur Sean Lafontaine, responsable du laboratoire de technicologie de l&#8217;université d&#8217;<a href="http://fr.wikipedia.org/wiki/Ittoqqortoormiit">Ittoqqortoormiit</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2013/04/25/ittoqqortoormiit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Paris sous la neige / Snow in Paris</title>
		<link>http://eric.van-der-vlist.com/blog/2013/03/13/paris-sous-la-neige-snow-in-paris/</link>
		<comments>http://eric.van-der-vlist.com/blog/2013/03/13/paris-sous-la-neige-snow-in-paris/#comments</comments>
		<pubDate>Wed, 13 Mar 2013 13:58:08 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Français]]></category>
		<category><![CDATA[Personnel/Personal]]></category>
		<category><![CDATA[neige]]></category>
		<category><![CDATA[paris]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[snow]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=865</guid>
		<description><![CDATA[Quelques photos de Paris sous la neige&#8230; / Some pictures of snow in Paris]]></description>
				<content:encoded><![CDATA[<p><a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090200.JPG"><img src='http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090200.JPG' alt='Paris sous la neige' class='ngg-singlepic ngg-none size-full' /></a></p>
<h3>Quelques photos de Paris sous la neige&#8230; / Some pictures of snow in Paris</h3>
<div class="ngg-galleryoverview" id="ngg-gallery-68-865">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-5298" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090189.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090189" alt="P1090189" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090189.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5299" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090190.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090190" alt="P1090190" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090190.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5300" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090191.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090191" alt="P1090191" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090191.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5301" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090192.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090192" alt="P1090192" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090192.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5302" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090193.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090193" alt="P1090193" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090193.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5303" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090194.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090194" alt="P1090194" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090194.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5304" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090195.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090195" alt="P1090195" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090195.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5305" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090196.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090196" alt="P1090196" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090196.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5306" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090197.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090197" alt="P1090197" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090197.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5307" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090198.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090198" alt="P1090198" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090198.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5308" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090199.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090199" alt="P1090199" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090199.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5309" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090200.JPG" title=" " class="shutterset_set_68" >
								<img title="Paris sous la neige" alt="Paris sous la neige" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090200.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5310" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090201.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090201" alt="P1090201" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090201.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5311" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090202.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090202" alt="P1090202" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090202.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5312" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090203.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090203" alt="P1090203" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090203.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5313" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090204.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090204" alt="P1090204" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090204.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5314" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090205.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090205" alt="P1090205" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090205.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5315" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090206.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090206" alt="P1090206" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090206.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5316" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090207.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090207" alt="P1090207" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090207.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5317" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090208.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090208" alt="P1090208" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090208.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5318" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090209.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090209" alt="P1090209" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090209.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5319" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090210.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090210" alt="P1090210" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090210.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5320" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090211.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090211" alt="P1090211" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090211.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5321" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090212.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090212" alt="P1090212" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090212.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5322" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090213.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090213" alt="P1090213" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090213.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5323" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090214.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090214" alt="P1090214" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090214.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5324" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090215.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090215" alt="P1090215" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090215.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5325" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090217.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090217" alt="P1090217" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090217.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5326" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090218.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090218" alt="P1090218" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090218.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5327" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090219.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090219" alt="P1090219" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090219.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5328" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090220.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090220" alt="P1090220" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090220.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5329" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090221.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090221" alt="P1090221" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090221.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5330" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090222.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090222" alt="P1090222" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090222.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5331" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090223.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090223" alt="P1090223" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090223.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5332" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090224.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090224" alt="P1090224" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090224.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5333" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090225.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090225" alt="P1090225" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090225.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5334" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090226.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090226" alt="P1090226" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090226.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5335" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090227.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090227" alt="P1090227" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090227.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5336" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090228.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090228" alt="P1090228" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090228.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5337" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090229.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090229" alt="P1090229" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090229.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5338" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/P1090230.JPG" title=" " class="shutterset_set_68" >
								<img title="P1090230" alt="P1090230" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/20130313-neige/thumbs/thumbs_P1090230.JPG" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class="ngg-clear"></div> 	
</div>

]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2013/03/13/paris-sous-la-neige-snow-in-paris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When MVC becomes a burden for XForms</title>
		<link>http://eric.van-der-vlist.com/blog/2013/03/06/when-mvc-becomes-a-burden-for-xforms/</link>
		<comments>http://eric.van-der-vlist.com/blog/2013/03/06/when-mvc-becomes-a-burden-for-xforms/#comments</comments>
		<pubDate>Wed, 06 Mar 2013 10:40:42 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Programming/Programmation]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[hmvc]]></category>
		<category><![CDATA[modularity]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[orbeon forms]]></category>
		<category><![CDATA[soc]]></category>
		<category><![CDATA[xforms]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=849</guid>
		<description><![CDATA[XForms describes itself as a MVC architecture: An XForm allows processing of data to occur using three mechanisms: a declarative model composed of formulae for data calculations and constraints, data type and other property declarations, and data submission parameters a view &#8230; <a href="http://eric.van-der-vlist.com/blog/2013/03/06/when-mvc-becomes-a-burden-for-xforms/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>XForms <a title="XForms 1.1 W3C Recommendation" href="http://http://www.w3.org/TR/xforms11/">describes itself</a> as a <a title="Model-view-controller on Wikipedia" href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">MVC</a> architecture:</p>
<blockquote><p>An XForm allows processing of data to occur using three mechanisms:</p>
<ul>
<li>a declarative <b>model</b> composed of formulae for data calculations and constraints, data type and other property declarations, and data submission parameters</li>
<li>a <b>view</b> layer composed of intent-based user interface controls</li>
<li>an imperative <b>controller</b> for orchestrating data manipulations, interactions between the model and view layers, and data submissions.</li>
</ul>
</blockquote>
<p>Micah Dubinko <a href="http://http://dubinko.info/blog/2010/09/02/is-xforms-really-mvc/">argues</a> that the mapping is more obvious with <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter">Model-view-presenter (MVP)</a>, a derivative of the MVC software pattern but that&#8217;s not the point I&#8217;d like to make and I&#8217;ll stick to the MVC terminology where:</p>
<ul>
<li>The model is composed of XForms instances and binds</li>
<li>The view is composed of the XForms controls together with the HTML elements and CSS stylesheets</li>
<li>The controller is composed of the actions</li>
</ul>
<div class="wp-caption aligncenter" style="width: 510px"><a href="http://commons.wikimedia.org/wiki/File:MVC-Process.svg"><img alt="Mode-view-controler on wikimedia" src="http://upload.wikimedia.org/wikipedia/commons/a/a0/MVC-Process.svg" width="500" height="550" /></a><p class="wp-caption-text">Mode-view-controler on wikimedia</p></div>
<p><a href="http://wiki.orbeon.com/forms/doc/user-guide/form-builder-user-guide">Orbeon Form Builder</a> goes one step forward and adds a fourth concern for localization and we get a model/view/localization/controller pattern.</p>
<p>This <a href="http://en.wikipedia.org/wiki/Separation_of_concerns">separation of concerns</a> is great to differentiate different roles and split work between specialists but doesn&#8217;t play well with <a href="http://http://en.wikipedia.org/wiki/Modular_programming">modularity</a> and <a href="http://en.wikipedia.org/wiki/Reusability">reusability</a>.</p>
<p>I am currently working on a project to develop big and complex forms and this is becoming one of the biggest issues: these forms share a number of common fields and group of fields and, not even speaking of sharing these definitions, this separation of concerns adds a significant burden when copying these definitions from one form to another.</p>
<p>To copy a field from one form to another you need to copy definitions from the model, the view, the localization and the controller and can&#8217;t just copy a &#8220;component&#8221;.</p>
<p>And of course, there is no easy way to reuse common components instead of copying them.</p>
<p>I am not the first to question this issue with MVC and the <a href="http://en.wikipedia.org/wiki/Hierarchical_model%E2%80%93view%E2%80%93controller">Hierarchical model–view–controller (HMVC)</a> has been <a href="http://www.javaworld.com/javaworld/jw-07-2000/jw-0721-hmvc.html">introduced for this purpose</a>, but how can we use such a pattern with XForms?</p>
<div class="wp-caption aligncenter" style="width: 435px"><a href="http://www.javaworld.com/javaworld/jw-07-2000/jw-0721-hmvc.html?page=2"><img alt="Hierarchical model-view-controller in JavaWorld" src="http://www.javaworld.com/javaworld/jw-07-2000/images/jw-0721-hmvc1.gif" width="425" height="264" /></a><p class="wp-caption-text">Hierarchical model-view-controller in JavaWorld</p></div>
<p>In fact, I m wondering if some of the innovative ways to develop XForms application which have been presented during the <a href="http://www.xmlprague.cz/pre-conference-friday/">XML Prague 2013 pre-conference day</a> were not more or less ways to deal with this issue.</p>
<p>For Orbeon Forms the way to deal with reusability issues is through <a href="http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide">XBL components</a>.</p>
<p>XBL components cleanly encapsulate their own model/view/controller concerns but their development is highly technical and can&#8217;t be defined using Form Builder: you can use XBL components in Form Builder but you have to create them by hand and there is no way to just say &#8220;I want to define this group of fields as a new XBL component and use this component in other forms&#8221;. Such a feature would be most useful!</p>
<p>Another way to deal with this issue is to use a meta model and generate XForms. I am involved in another project which is following this path and you can expect to hear more about it in these pages!</p>
]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2013/03/06/when-mvc-becomes-a-burden-for-xforms/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>XML Prague 2013</title>
		<link>http://eric.van-der-vlist.com/blog/2013/02/12/xml-prague-2013/</link>
		<comments>http://eric.van-der-vlist.com/blog/2013/02/12/xml-prague-2013/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 19:43:11 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[xml prague]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=836</guid>
		<description><![CDATA[XML Prague is over&#8230; As usual it&#8217;s very difficult to go back to work after these three intense days of deeply technical friendly exchange. The feeling is well known by attendees and has been described by Alex Milowski has Post &#8230; <a href="http://eric.van-der-vlist.com/blog/2013/02/12/xml-prague-2013/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h3>XML Prague is over&#8230;</h3>
<p><a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/xmlprague2013/P1090188.JPG"><br />
<img class="ngg-singlepic ngg-none size-full" alt="The XML Prague 2013 team" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/xmlprague2013/P1090188.JPG" /></a><br />
As usual it&#8217;s very difficult to go back to work after these three intense days of deeply technical friendly exchange. The feeling is well known by attendees and has been described by Alex Milowski has <a href="https://twitter.com/alexmilowski/status/300866923338555392">Post XML Prague depression</a>!</p>
<p>Unlike previous years I will not publish a post covering the whole conference (I am too busy at the moment) but will rather publish several short articles on specific topics.<br />
Stay tuned! In the meantime you may want to have a look at my <a href="http://eric.van-der-vlist.com/blog/gallery/conferences/xml-prague-2013/">pictures</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2013/02/12/xml-prague-2013/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prend le gaz de schiste et tire toi</title>
		<link>http://eric.van-der-vlist.com/blog/2013/01/04/prend-le-gaz-de-schiste-et-tire-toi/</link>
		<comments>http://eric.van-der-vlist.com/blog/2013/01/04/prend-le-gaz-de-schiste-et-tire-toi/#comments</comments>
		<pubDate>Fri, 04 Jan 2013 22:20:35 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[Environnement]]></category>
		<category><![CDATA[Français]]></category>
		<category><![CDATA[co2]]></category>
		<category><![CDATA[gaz de schiste]]></category>
		<category><![CDATA[radio]]></category>
		<category><![CDATA[réchauffement climatique]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=806</guid>
		<description><![CDATA[Le 15 novembre dernier, Les Matins de France Culture recevaient Corinne Lepage. Je n&#8217;ai pas eu le temps de le faire, mais j&#8217;aimerais revenir sur ce haut moment de radio qui me semble bien résumer le débat actuel autour de &#8230; <a href="http://eric.van-der-vlist.com/blog/2013/01/04/prend-le-gaz-de-schiste-et-tire-toi/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Le 15 novembre dernier, Les Matins de France Culture recevaient <a href="http://fr.wikipedia.org/wiki/Corinne_Lepage">Corinne Lepage</a>. Je n&#8217;ai pas eu le temps de le faire, mais j&#8217;aimerais revenir sur ce haut moment de radio qui me semble bien résumer le débat actuel autour de ce qu&#8217;on appelle &#8220;hydrocarbures non conventionnels&#8221;.</p>
<p>Le débat a opposé Corinne Lepage au chroniqueur <a href="http://www.franceculture.fr/personne-brice-couturier">Brice Couturier</a> secondé par l&#8217;économiste <a href="http://www.franceculture.fr/personne-agnes-benassy-quere">Agnès Bénassy-Quéré</a>. Il était arbitré par le producteur/présentateur <a href="http://www.franceculture.fr/personne-marc-voinchet">Marc Voinchet</a> et  le journaliste politique <a href="http://www.franceculture.fr/personne-frédéric-métézeau.html">Frédéric Métézeau</a>.</p>
<p>Vous pouvez retrouver cette émission <a href="http://www.franceculture.fr/emission-les-matins-l-invite-politique-de-la-semaine-corinne-lepage-2012-11-15">sur le site de France Culture</a>,la <a href="http://www.franceculture.fr/player/reecouter?play=4535685">réécouter</a> ou la <a href="http://rf.proxycast.org/m/media/296096201420.mp3?c=culture&amp;p=LES+MATINS+DE+FRANCE+CULTURE_10075&amp;l3=20121115&amp;l4=&amp;media_url=http%3A%2F%2Fmedia.radiofrance-podcast.net%2Fpodcast09%2F10075-15.11.2012-ITEMA_20420303-0.mp3">télécharger</a>. Pour que vous puissiez juger par vous même, je publie également la transcription de la partie qui traite des gaz de schiste à la fin de cet article. Elle se commence 1h49:25 après le début du fichier mp3 téléchargeable sur le site de France Culture.</p>
<p>Le métier des chroniqueurs est de savoir tout sur tout, d&#8217;avoir toujours raison et de ne pas admettre la contradiction. La chronique de Brice Couturier a fait l&#8217;apologie des gaz de schistes en utilisant quelques arguments imparables :</p>
<ul>
<li> &#8221;les États-Unis qui sont déjà les premiers producteurs de gaz au monde vont devenir dès la fin de cette décennie les premiers producteurs de pétrole en passant de 8 millions de barils par jour aujourd&#8217;hui à 12 millions en 2020&#8243;</li>
<li>&#8220;Pouvons nous à la fois fermer des centrales nucléaire, renoncer à toute forme d&#8217;exploitation des gaz non conventionnels et prétendre réduire nos émissions de CO<sub>2</sub> ?&#8221;</li>
<li>&#8220;Des entreprises françaises comme <a href="http://fr.wikipedia.org/wiki/Total_%28entreprise%29">Total</a>, <a href="http://fr.wikipedia.org/wiki/Vallourec">Vallourec</a> ou <a href="http://fr.wikipedia.org/wiki/Solvay_%28entreprise%29">Solvay</a> sont déjà en pointe dans cette technologie&#8221;.</li>
<li>&#8220;On sait qu&#8217;au sein même du gouvernement <a href="http://fr.wikipedia.org/wiki/Arnaud_Montebourg">Arnaud Montebourg</a> ou <a href="http://fr.wikipedia.org/wiki/Alain_Vidalies">Alain Vidalies</a> le souhaitent, mais il s&#8217;agit là pour les écologistes qui l&#8217;ont fait savoir d&#8217;un <a href="http://fr.wikipedia.org/wiki/Casus_belli">casus belli</a>. Alors la logique politicienne doit elle l&#8217;emporter sur la logique industrielle ?&#8221;</li>
</ul>
<p>Les chiffres indiqués par Brice Couturier concernant les États-Unis sont tirés d&#8217;un récent rapport de l&#8217;Agence Internationale de l’Énergie décortiqué par un <a href="http://www.lesechos.fr/entreprises-secteurs/energie-environnement/actu/0202378733266-petrole-demande-et-prix-vont-grimper-d-ici-a-2035-selon-l-aie-509753.php">article des Échos</a>. Par contre Solvay n&#8217;est pas une entreprise française. Créé par un inventeur Belge, cette société se définit comme &#8220;internationale&#8221; et son siège social est à Bruxelles.</p>
<p>La question avec laquelle il clôt sa chronique (&#8220;la logique politicienne doit elle l&#8217;emporter sur la logique industrielle ?&#8221;) est symptomatique. Pourquoi utiliser un terme aussi négatif que &#8220;politicien&#8221;? Si l&#8217;on écoute les écologistes, c&#8217;est nécessairement pour des raisons politiciennes? C&#8217;est le type de questions auxquelles on s&#8217;attend sur Europe 1 ou sur ce qu&#8217;est devenu France Inter, mais sur France Culture, pourquoi ne pas avoir posé une vrai question telle que &#8220;le politique doit-il l&#8217;emporter sur l&#8217;industriel (ou l&#8217;économie ou la finance)?&#8221;?</p>
<p>Semblant être un moment décontenancée,  Corinne Lepage évacue la question (&#8220;La question ce n&#8217;est pas de savoir si ça fait plaisir aux verts ou si ça fait pas plaisir aux verts. La question est de savoir si c&#8217;est notre intérêt ou si ce n&#8217;est pas notre intérêt.&#8221;) et cherche une première fois à orienter le débat vers le problème de fond :</p>
<blockquote><p>Le problème est, alors là je ne parle pas pour la France, je parle de problème général, nous allons directement à l&#8217;opposé de ce que nous voulions faire collectivement lorsque nous avons dit « pour lutter contre les gaz à effet de serre il faut sortir de la société du pétrole ». Là nous nous enfonçons dans la société du pétrole. Cela veut donc dire que nous prenons délibérément le risque en rajoutant 30, 40, 50, 60 pour-cents, je n&#8217;en sais rien, d&#8217;hydrocarbures supplémentaires d’augmenter la température non pas de 3 ou 4 degrés à la fin du siècle mais beaucoup plus et de mettre en péril carrément tout notre système. Ça c&#8217;est pas vrai seulement pour la France, c&#8217;est un problème global, autrement dit, vous parliez d&#8217;émission de gaz à effet de serre, pour moi c&#8217;est le problème numéro un. Et vous savez comme moi que l&#8217;exploitation des gaz de schiste, c&#8217;est des émissions de méthane en quantité absolument industrielle, le méthane, la tonne de méthane étant vingt-quatre fois plus grave pour l&#8217;effet de serre que la tonne de CO2.</p></blockquote>
<p>Elle cherchera ainsi plusieurs fois à expliquer que l&#8217;exploitation d&#8217;hydrocarbures non conventionnels ne fait que prolonger un comportement suicidaire et à revenir sur la nécessité de réduire nos besoins en hydrocarbures pour éviter une catastrophe écologique.</p>
<p>Ses contradicteurs ne lui répondront jamais sur ce point. Sans se donner la peine de contester le réchauffement climatique, ils préfèrent l&#8217;ignorer!</p>
<p>Lors d&#8217;un échange particulièrement confus où Corinne Lepage et Brice Couturier se coupent mutuellement plusieurs fois la parole, celui-ci montre clairement le peu d&#8217;importance qu&#8217;il accorde à cet argument majeur qui devrait pourtant se suffire à lui même :</p>
<blockquote><p>On voulait sortir du pétrole parce qu&#8217;il n&#8217;y en avait plus, maintenant on nous dit qu&#8217;il y en a encore, voyez c&#8217;est ça le problème, maintenant on nous dit il y en a encore pour cent ans donc c&#8217;est bizarre de reprendre l&#8217;argumentation il faut sortir du pétrole.</p></blockquote>
<p>Corinne le Page tente alors une nième fois de se faire comprendre :</p>
<blockquote><p>Non monsieur, excusez moi monsieur Couturier. On n&#8217;a pas dit ça, on a dit on est obligé de sortir du pétrole parce qu&#8217;on en a plus, et on doit en sortir à cause des émissions de gaz à effet de serre, parce que nous devons impérativement réduire les émissions de gaz à effet de serre de manière à ne pas augmenter de manière déraisonnable la température à la surface du globe.</p></blockquote>
<p>Elle ne pourra terminer son argumentation sans que Brice Couturier lui coupe à nouveau la parole pour détourner la conversation.</p>
<p>Vers la fin du débat, alors que l&#8217;on semblait tourner en rond, Frédéric Métézeau sauve un peu la situation en abordant la question des explorations, donnant l&#8217;occasion à Corine Lepage de dénoncer l&#8217;hypocrisie de ces contrats dits &#8220;d&#8217;exploration&#8221; :</p>
<blockquote><p>le problème c&#8217;est que, en droit quand vous avez un droit d&#8217;exploration vous avez derrière un droit d&#8217;exploitation, c&#8217;est comme cela que ça marche, il n&#8217;y a plus d&#8217;appel à la concurrence, c&#8217;est terminé. C&#8217;est à dire qu&#8217;il suffit de délivrer des permis d&#8217;exploration à toute une série de gens, ils peuvent geler les terrains pour des années et des années et de toute façon ils auront l&#8217;exploitation derrière. &#8230;/&#8230; Je pense que la recherche c&#8217;est à l&#8217;état de la faire, alors ensuite qu&#8217;il la contrôle, qu&#8217;il la fasse pas nécessairement directement mais qu&#8217;il la contrôle de manière qu&#8217;il n&#8217;y ait aucun droit de nature patrimoniale sous quelque forme que ce soit qui soit donné à qui que ce soit tant que l&#8217;on ne sait pas ce que l&#8217;on fait.</p></blockquote>
<p>Cela provoque de vives réactions de la part d&#8217;Agnès Bénassy-Quéré : &#8220;mais alors, comment est-ce que l&#8217;état va inciter les entreprises à travailler à fond perdu ?&#8221; et de Brice Couturier &#8220;c&#8217;est une façon de fermer la porte de dire ça, hein, c&#8217;est une façon de dire puisque personne n&#8217;y aura intérêt personne ne le fera, hein, c&#8217;est une façon de fermer&#8221;.</p>
<p>Autrement dit, il est hors de question que notre pays investisse pour évaluer les ressources de son sous sol et il est inévitable que l&#8217;on accorde des permis &#8220;d&#8217;exploration&#8221; qui donnent des droits d&#8217;exploitation que l&#8217;on ne pourra plus contrôler&#8230;</p>
<p>J&#8217;ai gardé l&#8217;échange qui m&#8217;a fait le plus bondir, celui qui justifie ce long article pour la fin&#8230;</p>
<p>Corine Lepage ayant suggéré qu&#8217;il n&#8217;était peut être pas très urgent d&#8217;exploiter les gaz de schiste, Brice Couturier cite Louis Gallois : &#8220;Ce que dit Louis Gallois, il dit que si l&#8217;on attend trop, justement, on risque de se priver d&#8217;une grande part de ressource économique&#8221;. Corinne Lepage répond placidement &#8220;bah attendez ça partira pas, donc si c&#8217;est là c&#8217;est là&#8221;.</p>
<p>Cela semble évident, mais Agnès Bénassy-Quéré relance le débat dès qu&#8217;on lui donne la parole :</p>
<blockquote><p>Les pays qui ont beaucoup de pétrole ne font pas ce raisonnement. Au contraire, ils veulent sortir leur pétrole relativement vite de leur sol parce que ils se disent il va y avoir une nouvelle révolution industrielle dé-carbonée, l&#8217;invention, on l&#8217;a pas l&#8217;innovation énergétique, euh, l&#8217;éolien c&#8217;est pas ça, le photo voltaïque c&#8217;est pas ça, on l&#8217;aura un jour peut être et ils se disent là il y a une fenêtre dans laquelle on va gagner beaucoup d&#8217;argent en sortant notre pétrole, mais ce ne sera pas éternel. Donc il y un risque que la France rate une période où il n&#8217;y a pas justement cette nouvelle innovation qui nous manque pour faire la croissance verte, qui va venir peut être mais qu&#8217;on n&#8217;a pas pour l&#8217;instant, elle rate cette fenêtre et donc le gaz, pourquoi pas, il restera éternellement sous nos pieds.</p></blockquote>
<p>Je n&#8217;avais jamais entendu cet argument aussi clairement et cyniquement exposé!</p>
<p>Autrement dit : &#8220;prenons le gaz de schiste et tirons nous&#8221; ou encore &#8220;on sait que l&#8217;on ne va pas pouvoir continuer à emmètre des gaz à effet de serre très longtemps et que des empêcheurs de polluer en rond vont finir par obtenir gain de cause alors dépêchons nous de brûler le plus d&#8217;hydrocarbures possible le plus rapidement possible tant qu&#8217;il en est encore temps&#8221;.</p>
<p>J&#8217;imagine que ces gens là ont du faire les soldes pour isoler leur maisons à l&#8217;amiante et les repeindre avec des peintures au plomb juste avant qu&#8217;on interdisse ces produits!</p>
<p>Si vous avez encore un peu de temps, lisez la transcription : je trouve ce débat édifiant.</p>
<h3>Transcription</h3>
<style type="text/css"><!--
@page { margin: 2cm }
		P { margin-bottom: 0.21cm }
		A:link { so-language: zxx }
--></style>
<p><a href="http://www.franceculture.fr/emission-les-matins-l-invite-politique-de-la-semaine-corinne-lepage-2012-11-15">France Culture 15 novembre 2012</a></p>
<ul>
<li><a href="http://www.franceculture.fr/personne-marc-voinchet">Marc Voinchet</a> (producteur)  &#8211; MV</li>
<li><a href="http://www.franceculture.fr/personne-frédéric-métézeau.html">Frédéric Métézeau</a> (politique) &#8211; FM</li>
<li><a href="http://www.franceculture.fr/personne-agnes-benassy-quere">Agnès Bénassy-Quéré</a> (idées claires) -ABQ</li>
<li><a href="http://www.franceculture.fr/personne-brice-couturier">Brice Couturier</a> (chroniqueur) -BC</li>
</ul>
<p><em>Note : je n&#8217;ai pas voulu &#8220;éditer&#8221; les paroles échangées lors du débat mais ai au contraire cherché à en faire une transcription aussi fidèle que possible.</em></p>
<p>1:49:25 MV : Et à huit heures et 18 minutes, je vous rappelle donc, émission politique du matin, aujourd&#8217;hui Corine Lepage (CLP) avec Frédéric Métézeau, c&#8217;est l&#8217;heure de la chronique de Brice Couturier où je vous sens mettre les gaz..</p>
<p>1:49:25 BC : (rires) C&#8217;est l&#8217;expression, oui, Marc. Écoutez, vous savez peut-être que le ministre des finances vient de l’annoncer, je le cite, je cite le ministre des finances, « nous discutons actuellement d&#8217;un nouveau régime fiscal généreux pour encourager le gaz de schiste afin de rester compétitifs vis à vis des États-Unis ». Des incitations fiscales pour l&#8217;exploitation de gaz de schiste tels que ceux qui favorisent à prix d&#8217;or l&#8217;installation d&#8217;éoliennes et de panneaux photo-voltaïques ? Allons, allons, rassurez vous les écologistes, il ne s&#8217;agit pas de <a href="http://fr.wikipedia.org/wiki/Pierre_Moscovici">Pierre Moscovici</a>. Non, ce n&#8217;est pas du ministre français des finances qu&#8217;il s&#8217;agit, encore moins d&#8217;ailleurs du ministre des finances allemand, même si celui-ci a tendance ces temps ci à s&#8217;inquiéter de l&#8217;envolée de la facture électrique de l&#8217;Allemagne pour cause de tournant énergétique. Mais des élections ont lieu l&#8217;an prochain chez nos voisins et la chancelière chrétienne-démocrate est prête à former une coalition avec les verts actuellement crédités de 15 % des intentions de vote. Non, le ministre des finances en question c&#8217;est le britannique <a href="http://fr.wikipedia.org/wiki/George_Osborne">George Osborne</a>. Chez nous c&#8217;est un sujet qui est resté longtemps absent du débat publique mais il est en train d&#8217;y faire une percée remarquable. l&#8217;Amérique du nord, tant les États-Unis d&#8217;Obama que le Canada ont mis en exploitation leurs énormes réserves de gaz et de pétrole non conventionnels. C&#8217;est une révolution dans le domaine de l&#8217;énergie. Elle a déjà et elle aura des conséquences auxquelles nous ferions bien de réfléchir. Parce que les États-Unis qui sont déjà les premiers producteurs de gaz au monde vont devenir dès la fin de cette décennie les premiers producteurs de pétrole en passant de 8 millions de barils par jour aujourd&#8217;hui à 12 millions en 2020. Ils vont cesser complètement de dépendre des approvisionnements pétroliers du Golfe Persique et cela ne sera pas sans incidence sur leur diplomatie. Il n&#8217;y aura plus de guerre pour le pétrole, ou plutôt, assurer la liberté de circulation des voies maritimes entre Golfe Persique et Canal de Suez ne sera plus de leur ressort mais de celui des importateurs de pétrole que nous sommes nous les chinois et les européens en particulier. En aurons nous la volonté et les moyens ? Ensuite parce que l&#8217;énergie bon marché fournie aux entreprises par ce nouveau moyen n&#8217;est pas pour rien dans la ré-industrialisation menée avec succès par Obama et elle explique en partie les relocalisations dont les États-Unis bénéficient en ce moment. Entre parenthèses, le fameux peak oil que le club de Rome prévoyait aux alentours de 1980 et que l&#8217;on a cru à nouveau venu vers 2008 semble reculer toujours plus grâce à de nouvelles techniques d&#8217;extraction donc méfions nous des peak oils. Mais celles ci, ces techniques d&#8217;exploitation, se révèlent de plus en plus problématiques. C&#8217;est vrai, l&#8217;exploitation des gaz de schiste par la technique du forage directionnel horizontal et d&#8217;hydro-fracturation est polluante. En particulier parce qu&#8217;elle nécessité l&#8217;usage de millions de litres d&#8217;eau auxquels on ajoute des produits chimiques dont nul ne sait s&#8217;ils ne vont pas se répandre dans les nappes phréatiques si les puits ne sont pas suffisamment étanches. En outre les roches fracturées par ce procédé libèrent des substances toxiques. Alors oui, il faut faire preuve de prudence mais un pays comme le notre qui recèlerait cent fois sa consommation annuelle de gaz dans son sous sol peut il renoncer absolument à toute exploration ? Pouvons nous à la fois fermer des centrales nucléaire, renoncer à toute forme d&#8217;exploitation des gaz non conventionnels et prétendre réduire nos émissions de CO<sub>2</sub> ? Des entreprises françaises comme Total, Vallourec ou Solvay sont déjà en pointe dans cette technologie, toutes sortes de bons esprits, de <a href="http://fr.wikipedia.org/wiki/Louis_Gallois">Louis Gallois</a> à <a href="http://fr.wikipedia.org/wiki/Michel_Rocard">Michel Rocard</a> plaident pour que notre pays ne referme pas la porte d&#8217;une exploitation raisonnable des énormes réserves énergétiques que nous avons sous nos pieds. On sait qu&#8217;au sein même du gouvernement <a href="http://fr.wikipedia.org/wiki/Arnaud_Montebourg">Arnaud Montebourg</a> ou <a href="http://fr.wikipedia.org/wiki/Alain_Vidalies">Alain Vidalies</a> le souhaitent, mais il s&#8217;agit là pour les écologistes qui l&#8217;ont fait savoir d&#8217;un <a href="http://fr.wikipedia.org/wiki/Casus_belli">casus belli</a>. Alors la logique politicienne doit elle l&#8217;emporter sur la logique industrielle ?</p>
<p>1:53:25MV : La chronique de Brice Couturier, à retrouver sur <a href="http://www.franceculture.fr/">franceculture.fr</a>. Corinne Lepage :</p>
<p>1:53:30 CLP Oui&#8230; Euh&#8230; Alors, je.. On me dirait, monsieur Couturier, sur votre dernière phrase, la logique politicienne doit elle l&#8217;emporter sur la logique industrielle, je répondrais évidemment non. Mais c&#8217;est pas de ça dont il s&#8217;agit à mes yeux. La question ce n&#8217;est pas de savoir si ça fait plaisir aux verts ou si ça fait pas plaisir aux verts. La question est de savoir si c&#8217;est notre intérêt ou si ce n&#8217;est pas notre intérêt. Moi c&#8217;est comme cela que je pose la question, je ne la pose pas autrement. Alors, premier point, je dirais un point général. Vous avez parlé du peak-oil. Il a eu effectivement lieu pour le conventionnel en 2006, à peu près, 2006 – 2007. Donc maintenant si effectivement on parle de réserves pour des dizaines d&#8217;années, c&#8217;est précisément par ce qu&#8217;on recourt à tout ce que l&#8217;on appelle les hydrocarbures non conventionnels, gaz et pétrole, sables bitumineux au Canada, etc, etc&#8230; Le problème est, alors là je ne parle pas pour la France, je parle de problème général, nous allons directement à l&#8217;opposé de ce que nous voulions faire collectivement lorsque nous avons dit « pour lutter contre les gaz à effet de serre il faut sortir de la société du pétrole ». Là nous nous enfonçons dans la société du pétrole. Cela veut donc dire que nous prenons délibérément le risque en rajoutant 30, 40, 50, 60 pour-cents, je n&#8217;en sais rien, d&#8217;hydrocarbures supplémentaires d’augmenter la température non pas de 3 ou 4 degrés à la fin du siècle mais beaucoup plus et de mettre en péril carrément tout notre système. Ça c&#8217;est pas vrai seulement pour la France, c&#8217;est un problème global, autrement dit, vous parliez d&#8217;émission de gaz à effet de serre, pour moi c&#8217;est le problème numéro un. Et vous savez comme moi que l&#8217;exploitation des gaz de schiste, c&#8217;est des émissions de méthane en quantité absolument industrielle, le méthane, la tonne de méthane étant vingt-quatre fois plus grave pour l&#8217;effet de serre que la tonne de CO2. Ça c&#8217;est le premier point.</p>
<p>1:55:23 BC: (lui coupant la parole) D&#8217;autres avancent d&#8217;autres chiffres en disant que la question des gaz à effet de serre est moindre avec l&#8217;exploitation des gaz de schistes.</p>
<p>1:55:29 CLP : Alors, ils comparent par rapport au charbon, mais c&#8217;est pas sur parce que le charbon c&#8217;est pas du méthane c&#8217;est du CO2 et là on a du méthane et le méthane c&#8217;est beaucoup plus grave. Et donc vous parliez de fuites et vous avez raison au niveau des nappes phréatiques, mais c&#8217;est des fuites de méthane aussi de manière indéfinie. Donc on a un problème général. Deuxièmement, si la France a ce trésor sous les pieds, il va pas partir, il va pas s&#8217;enfuir. Vous savez comme moi que c&#8217;est pas parce que une baguette magique arriverait et on dirait d&#8217;accord, OK, on ouvre les vannes et on fait de l&#8217;exploration, vous savez très bien que sur le plan de l&#8217;économie française, 2012-2013 c&#8217;est effet 0, c&#8217;est pas pour maintenant, c&#8217;est pour dans plusieurs années, dans 7 ans, 8 ans, j&#8217;en sais rien, le temps qu&#8217;il faudrait pour faire de l&#8217;exploration et passer à une phase d&#8217;exploration, autrement dit aucun effet sur la situation économique actuelle. Donc je pense que 1) c&#8217;est gravissime, pour moi c&#8217;est une régression majeure</p>
<p>1:56:26 BC : (lui coupant la parole) Ce que dit Louis Gallois, il dit que si l&#8217;on attend trop, justement, on risque de se priver d&#8217;une grande part&#8230;</p>
<p>CLP : ben ça partira pas</p>
<p>BC : ressource économique</p>
<p>CLP : bah attendez ça partira pas, donc si c&#8217;est là c&#8217;est là moi si vous voulez, ce qui me fait très peur c&#8217;est tout les procédés autour et alentours, donc on fait pas de fracturation, mais on va aller chercher du pétrole, c&#8217;est ce qui se passe sous le Bassin Parisien, les sociétés pétrolières présentent ça sous une autre forme pour essayer de passer, etc, bon personne n&#8217;est dupe quand même, première observation. Deuxième observation, c&#8217;est les conséquences, nous sommes quand même pas les États-Unis, la France c&#8217;est pas le Texas, il a pas du tout les mêmes espaces, il y a des conflits, il va y avoir des conflits d&#8217;usage d&#8217;eau, des conflits d&#8217;usage de territoire, des problèmes sur l&#8217;activité agricole et agro-alimentaire etc, etc. Donc très franchement, je pense que sur le plan global c&#8217;est une catastrophe pour l&#8217;humanité et deuxièmement c&#8217;est franchement les avantages ne l&#8217;emportent certainement pas sur les inconvénients.</p>
<p>1:57:31MV : &#8220;Écologie, économie&#8221; disiez vous en première partie, comment concilier les deux, Corinne Lepage, alors comment fait on et débrouille t-on la question de ce que les entreprises françaises sont en pointe sur la question du gaz de schiste à l&#8217;étranger, pourquoi ne le seraient elles pas en France ?</p>
<p>1:57:45 CLP : Oui, enfin ça je vais vous dire, on est en face d&#8217;une telle</p>
<p>MV : (lui coupant la parole) Je vais vous donner&#8230; dans les échos d’aujourd’hui il y a un très bon dossier sur la question d&#8217;ailleurs qui fait&#8230;</p>
<p>CLP : nos journaux actuellement, ou tout du moins certains d&#8217;entre aux ont d&#8217;excellents dossiers, extrêmement bien montés, nous sommes en face d&#8217;une campagne, pour être correcte je dirais d&#8217;information, j&#8217;aurais peut être envie de dire un autre mot qui serait désinformation, mais restons sur l&#8217;information, extrêmement bien ciselée, on le voir partout, on l&#8217;entend partout, et tout est fait pour essayer de faire changer les français d&#8217;avis. Sauf que personne en France n&#8217;a envie d&#8217;avoir une exploitation de gaz de schiste à côté de chez lui, y compris&#8230;</p>
<p>1:58;23 MV : On est d&#8217;accord pour en acheter à l&#8217;étranger. Il y a un paradoxe tout de même</p>
<p>CLP : Parce que les conséquences&#8230; c&#8217;est des conséquences environnementales. Il y a deux types de conséquences, les conséquences planétaires dont je parlais tout à l&#8217;heure qui pour moi plaident en défaveur des gaz de schiste de manière&#8230;</p>
<p>MV ; on préfère que les autres exploitent par ailleurs des gaz de schistes que chez nous. Enfin on va en acheter tout de même !</p>
<p>CLP : Oui, on achète du pétrole parce qu&#8217;on en a pas vraiment chez nous&#8230;</p>
<p>BC : Mais là justement on en a. Je cite Rocard, Michel Rocard, c&#8217;est quand même pas un va t-en guerre ultra libéral victime des lobbys pétroliers ! Voilà ce qu&#8217;il dit, Michel Rocard dans le monde</p>
<p>CLP : Oui, j&#8217;ai lu</p>
<p>BC : « La France est bénie des dieux, pour l&#8217;Europe elle serait au gaz se schiste ce que le <a href="http://fr.wikipedia.org/wiki/Qatar">Qatar</a> est au pétrole, peut-on s&#8217;en priver ? Je ne le crois pas. » C&#8217;est du Rocard.</p>
<p>1:59:02 CLP : Oui, c&#8217;est du Rocard et d&#8217;un autre côté il dit «je suis écologiste et donc je suis très partagé » donc on cite que cette partie là et on cite pas l&#8217;autre où il est quand même beaucoup plus mesuré. Autrement dit vous risquez, en dehors de la question majeure qui pour moi est d’investir massivement pour sortir du pétrole, et je pense que nous sommes aussi une terre bénie des dieux pour le faire parce que nous avons tout ce qu&#8217;il faut en terme</p>
<p>BC : On voulait sortir du pétrole parce qu&#8217;il n&#8217;y en avait plus, maintenant on nous dit qu&#8217;il y en a</p>
<p>CLP : non, non, non</p>
<p>BC : encore, voyez c&#8217;est ça le problème</p>
<p>CLP : pas du tout</p>
<p>BC : maintenant on nous dit il y en a encore pour cent ans</p>
<p>CLP : non</p>
<p>BC : donc c&#8217;est bizarre de reprendre l&#8217;argumentation il faut sortir du pétrole</p>
<p>CLP : Non monsieur, excusez moi monsieur Couturier. On n&#8217;a pas dit ça, on a dit on est obligé de sortir du pétrole parce qu&#8217;on en a plus, et on doit en sortir à cause des émissions de gaz à effet de serre, parce que nous devons impérativement réduire les émissions de gaz à effet de serre de manière à ne pas augmenter de manière déraisonnable la température à la surface du globe. Vous vous rendez compte de</p>
<p>BC : vous vous rendez compte que pendant ce temps à les allemands sur la base du même principe sont en train de polluer toute l&#8217;Europe avec du charbon, parce que comme il ont renoncé</p>
<p>CLP : de moins en moins</p>
<p>BC : comme on renonce à la fois au nucléaire et on renonce au gaz de schiste on renonce à tout finalement et qu&#8217;est ce qui reste, le charbon et</p>
<p>CLP : non, pas du tout</p>
<p>BC : c&#8217;est quand même la calamité absolue le charbon</p>
<p>CLP : ils réduisent</p>
<p>BC : et les chinois aussi ils utilisent</p>
<p>CLP : alors premièrement ils</p>
<p>MV : Corine Lepage</p>
<p>CLP : ils ont des procédés d&#8217;utilisation du charbon qui sont quand même beaucoup moins polluants qu&#8217;ils n&#8217;étaient et deuxièmement je vous donne rendez vous dans cinq ou dix ans quand vous allez avoir une industrie allemande qui va être partout leader sur tout les nouveaux marchés qui vont être ceux de efficacité énergétique et des énergies renouvelables et que nous on sera encore à nous poser des questions sur les gaz de schistes et à continuer sur le nucléaire</p>
<p>BC : Mais tout de même, Corinne Lepage, mettant autant d&#8217;énergie à luter contre l&#8217;exploitation des gaz en France qu&#8217;on devrait en mettre par exemple sur le fait que les compagnies pétrolières du monde entier, notamment françaises, détruisent un pays comme le Nigeria aujourd&#8217;hui dont on ne résout toujours pas toutes les questions où les … sont effectivement morts, dont la population est accablée de toutes les maladies et où personne, strictement personne ne fait rien, au nom de notre indépendance énergétique.</p>
<p>CLP : Je suis complètement d&#8217;accord avec vous</p>
<p>BC …</p>
<p>CLP : oui, mais au Nigeria il s&#8217;est quand même passé une chose très intéressante c&#8217;est que BP s&#8217;est fait condamner à une amende absolument massive par les tribunaux nigérians</p>
<p>BC : encore faudra t-il qu&#8217;elle la paye</p>
<p>CLP : Oui c&#8217;est possible, mais n’empêche que, je revient un peu à mon dadas, on parlait tout à l&#8217;heure de la société civile, qu&#8217;est-ce qui est en train d&#8217;essayer de réorganiser un peu les pouvoirs dans ce monde, c&#8217;est la société civile et la justice. Parce que vous avez le Nigeria effectivement pour le pétrole et vous avez dans d&#8217;autres pays aussi du sud, où vous avez des actions de ce genre qui sont menées. Donc, je crois que les citoyens se rendent tout à fait compte de ce qui est en train de se passer. Et je suis très, très attentive aux questions de l&#8217;économie</p>
<p>BC : Beee</p>
<p>CLP Je me dis</p>
<p>MV : Attendez, justement je vais passer la parole à <a href="http://www.franceculture.fr/personne-agnes-benassy-quere">Agnès Bénassy-Quéré</a>. Economie/écologie, est-ce que dans cette question des gaz de schistes on est dans des conflits insolubles</p>
<p>2:02:00 ABQ : je voulais revenir rapidement sur le gaz ne va pas s&#8217;échapper, il est sous nos pieds, il va rester</p>
<p>CLP : Oui, et bah oui</p>
<p>ABQ : C&#8217;est un argument qui est tout à fait bon si par exemple on fait de la recherche par exemple pour voir s&#8217;il y une autre technique. Bon je sais qu&#8217;il y a des problèmes avec le code minier, etc. Mais sinon ça ne sert à rien, les pays qui ont beaucoup de pétrole ne font pas ce raisonnement. Au contraire, ils veulent sortir leur pétrole relativement vite de leur sol parce que ils se disent il va y avoir une nouvelle révolution industrielle dé-carbonée, l&#8217;invention, on l&#8217;a pas l&#8217;innovation énergétique, euh, l&#8217;éolien c&#8217;est pas ça, le photo voltaïque c&#8217;est pas ça, on l&#8217;aura un jour peut être et ils se disent là il y a une fenêtre dans laquelle on va gagner beaucoup d&#8217;argent en sortant notre pétrole, mais ce ne sera pas éternel. Donc il y un risque que la France rate une période où il n&#8217;y a pas justement cette nouvelle innovation qui nous manque pour faire la croissance verte, qui va venir peut être mais qu&#8217;on n&#8217;a pas pour l&#8217;instant, elle rate cette fenêtre et donc le gaz, pourquoi pas, il restera éternellement sous nos pieds.</p>
<p>CLP : Alors je vais répondre à cela. D&#8217;abord vous dites on l&#8217;a pas, moi je vois quand même ce qui se passe au niveau européen, je vous des pays comme l&#8217;Allemagne qui disent nous allons être à 40 % d&#8217;énergie renouvelable en 2020, c&#8217;est à dire demain matin, par conséquent je pense au contraire que, notamment sur l&#8217;éolien offshore, je pense sur les énergies marines, je pense sur le photo voltaïque je pense bien sur que les sociétés européennes sont en difficulté parce que le prix des cellules a chuté à cause des chinois dans des proportions tout à fait considérables, mais aujourd&#8217;hui vous avez un kW/h éolien qui est inférieur au kW/h qui sortira des nouvelles centrales nucléaires. Donc je crois qu&#8217;on peut pas dire qu&#8217;on y est pas, je pense précisément qu&#8217;on est en train d&#8217;y être et ce qui m&#8217;inquiète c&#8217;est les choix énergétiques que la France est en train de faire sur le plan industriel. Je parle pas d&#8217;écologie là, je parle d&#8217;industrie, je pense que nous sommes en train de louper précisément cette grande fenêtre de tir. Vous parliez d &#8217;énergie dé-carbonée, c&#8217;est précisément tout cela et ce qui se joue aujourd&#8217;hui c&#8217;est cale. Faut bien comprendre qu’investir massivement dans les gaz de schiste c&#8217;est quoi ? C&#8217;est avoir très vite une énergie qu&#8217;on va pas payer très cher même si on va la payer beaucoup plus cher qu&#8217;aux États-Unis contrairement à ce qu&#8217;on nous raconte parce que même aux États-Unis aujourd&#8217;hui on va être obligé de capter le méthane ce qui n&#8217;était pas le cas jusqu&#8217;à maintenant donc vous allez avoir un coût beaucoup plus élevé puis aux États-Unis vous avez des actions en réparation et les compagnies pétrolières elles vont payer pour les dommages immenses qu&#8217;elles on causé et donc c&#8217;est maintenant que la facture va venir, mais ça c&#8217;est un détail, mais vous allez avoir une difficulté de rentabilité des énergies renouvelables, précisément parce que vous allez avoir pendant un court moment une énergie qui va être probablement moins chère, ça c&#8217;est vrai mais avec des conséquences irréversibles ou très chères que nous allons payer après donc je ne suis pas sure que ce soit notre intérêt. Moi je suis fermée à rien, là où je ne suis pas d&#8217;accord, c&#8217;est quand on a des dés pipés, qu&#8217;on arrive pas à avoir des évaluations économiques correctes, des avantages et des inconvénients des différentes solutions.</p>
<p>2:04:58 MV : Mais, a t-on une évaluation scientifique, je pose la question sans malice, correcte ? Parce que on entend bien, absolument, ceux qui disent c&#8217;est très dangereux, voilà, et on en entend d&#8217;autres, alors, est-ce qu&#8217;ils sont soumis à des lobbys ou pas, je n&#8217;en sais rien mais on entend</p>
<p>BC : Mais pourquoi les premiers ne seraient pas aussi soumis à des lobbys ?</p>
<p>CLP : parce qu&#8217;ils ne cherchent pas d&#8217;argent</p>
<p>MV : … dans le Monde disait qu&#8217;il est possible d&#8217;exploiter je cite, proprement le gaz de schiste moyennant de gros investissements technologiques, il a rajouté, voilà, le jeu en vaut la chandelle a t-il affirmé.</p>
<p>CLP : Écoutez, moi j&#8217;en sait rien. On a auditionné beaucoup de gens au parlement européen puisque moi je suis rapporteur sur le texte sur les gaz de schiste, je peux vous dire qu&#8217;on est en face d&#8217;un lobbying absolument démentiel</p>
<p>BC : Mais il y a un lobbying des deux côtés, il y a un lobbying de l&#8217;éolien qui est très efficace aussi, hein</p>
<p>CLP :&#8230;</p>
<p>BC : Ah oui, hein</p>
<p>CLP : Il est beaucoup plus petit et je peux vous dire qu&#8217;ils se font beaucoup moins entendre que les autres et ils ont beaucoup moins de moyens</p>
<p>BC : Auprès des médias je peux vous dire que c&#8217;est assez équivalent</p>
<p>CLP : Peut être mais auprès des députés c&#8217;est pas de même niveau et donc pour l&#8217;instant on est entrain d&#8217;essayer de nous empêcher</p>
<p>MV : en tout cas ils ont fait du lobbying pour éviter André de Margerie ici et il n&#8217;est toujours pas venu</p>
<p>CLP : de nous empêcher de passer une législation, parce que voyez vous s&#8217;il y avait une législation, le minimum c&#8217;est qu&#8217;il y ait une étude d&#8217;impact, c</p>
<p>BC : Vous demandez quoi précisément qu&#8217;on comprenne bien, sur la question</p>
<p>CLP : une législation</p>
<p>BC : sur la question de la sûreté, de la sécurité</p>
<p>CLP : bon, et bien, à minima, mais je maintiens et je le redis parce que pour moi c&#8217;est essentiel, c&#8217;est rétrograde parce que l&#8217;on fait de la régression par rapport à une société post-pétrolière, pour moi, ça c&#8217;est majeur. Mais admettons qu&#8217;on aille dans cette direction là</p>
<p>BC : voilà !</p>
<p>CLP : Minimum : une étude d&#8217;impact, obligatoire au départ, un système de responsabilité illimité, pour tous les dommages causés et une obligation d&#8217;assurance</p>
<p>BC : C&#8217;est l&#8217;avocate qui parle</p>
<p>CLP : C&#8217;est le juriste</p>
<p>BC ; Le juriste, oui</p>
<p>CLP : Parce que c&#8217;est très facile d&#8217;aller cochonner et j’emploie un mot poli une région entière et ensuite de dire je suis en faillite et débrouillez vous, c&#8217;est ce qu&#8217;on eu avec <a href="http://fr.wikipedia.org/wiki/Metaleurop">Metaleurop</a>, c&#8217;est ce qu&#8217;on a avec beaucoup de raffineries de pétrole, de sociétés de raffineries de pétrole qui vendent à des filiales ou d&#8217;autres sociétés qui n&#8217;ont pas un centime qui exploitent pendant un an, elles sont en faillite, et personne ne paie sauf vous et moi. Donc ça suffit. Par voix de conséquence, si on avait un système comme cela, c&#8217;est responsabilité illimitée et garanties financières qui vont avec. Et bien je vous assure que le coût il sera d&#8217;une autre nature que ce que l&#8217;on nous raconte aujourd&#8217;hui.</p>
<p>MV : <a href="http://www.franceculture.fr/personne-frédéric-métézeau.html">Frédéric Métézeau</a></p>
<p>FM : Oui, Corine Lepage, deux éléments pour nourrir le débat : avant hier mardi, la plus grande centrale solaire a été mise en service en Lorraine par EDF, donc de l&#8217;argent public et dans votre tribune publiée dans le Monde ce même jour, mardi « gaz de schiste a ses lobbyistes » vous écrivez « si le gaz de schiste présente un enjeu stratégique pour la France, alors la recherche et le recensement public des réserves ne peut se faire que par l&#8217;état ». EDF d&#8217;un côté, l&#8217;état de l&#8217;autre, est-ce que cela veut dire que la politique énergétique et l&#8217;action énergétique doivent revenir dans le giron de l&#8217;état et pas dans des sociétés privées que ce soit une énorme boite ou une PME ?</p>
<p>2:07:53 CLP : Je vais vous dire ? Ce qui me fait peur dans l’affaire de l&#8217;exploration. Moi je comprend bien qu&#8217;on dise on veut savoir, c&#8217;est logique</p>
<p>MV: Donc c&#8217;est bien la question de l&#8217;exploration</p>
<p>CLP : Oui, le problème c&#8217;est que, en droit quand vous avez un droit d&#8217;exploration vous avez derrière un droit d&#8217;exploitation, c&#8217;est comme cela que ça marche, il n&#8217;y a plus d&#8217;appel à la concurrence, c&#8217;est terminé. C&#8217;est à dire qu&#8217;il suffit de délivrer des permis d&#8217;exploration à toute une série de gens, ils peuvent geler les terrains pour des années et des années et de toute façon ils auront l&#8217;exploitation derrière. Donc ça c&#8217;est pas possible donc c&#8217;est la raison pour laquelle, parce que je ne suis pas quelqu&#8217;un qui suit pas fermé, j&#8217;essaye encore une fois, … C&#8217;est pas politicien, le choix entre industrie et politicien, non, c&#8217;est quel est l&#8217;intérêt général des français. Donc si c&#8217;est ça je pense que la recherche c&#8217;est à l&#8217;état de la faire, alors ensuite qu&#8217;il la contrôle, qu&#8217;il la fasse pas nécessairement directement mais qu&#8217;il la contrôle de manière qu&#8217;il n&#8217;y ait aucun droit de nature patrimoniale sous quelque forme que ce soit qui soit donné à qui que ce soit tant que l&#8217;on ne sait pas ce que l&#8217;on fait.</p>
<p>ABQ : Mais alors, comment est-ce que l&#8217;état va inciter les entreprises à travailler à fond perdu ?</p>
<p>BC : C&#8217;est une façon de fermer la porte de dire ça, hein, c&#8217;est une façon de dire puisque personne n&#8217;y aura intérêt personne ne le fera, hein, c&#8217;est une façon de fermer</p>
<p>CLP : Non, bah heuh, ça peut être une négociation autour effectivement du code minier de la manière dont on rémunère un simple permis de recherche pour savoir si il y en a ou s&#8217;il n&#8217;y en a pas. Mais je crois que c&#8217;est quelque chose de très très important.</p>
<p>2:09:12 BC : Je voudrais revenir à l&#8217;économie parce que ça me paraît fondamental. Il faut comprendre qu&#8217;aujourd&#8217;hui si les États-Unis sont en train de se réindustrialiser et c&#8217;est une des raisons pour lesquelles Obama a été élu, c&#8217;est précisément que les industriels américains aujourd&#8217;hui paient leur énergie deux fois et demi moins cher que nous</p>
<p>CLP : c&#8217;est vrai, c&#8217;est vrai</p>
<p>BC : hors les allemands la payent beaucoup plus cher et c&#8217;est pas sans rapport avec leur transition énergétique. Il faut savoir qu’aujourd’hui effectivement vous avez raison le solaire, l&#8217;éolien et l’hydraulique représentent 20 % de la consommation allemande d&#8217;électricité contre 17 % l&#8217;année précédente. Bon 20 % c&#8217;est pas mal, l&#8217;objectif est de 35 %</p>
<p>CLP : Ils viennent de 6 ou 7, hein, ils viennent de très très loin.</p>
<p>BC : c&#8217;est vrai, c&#8217;est vrai mais en attendant la facture énergétique allemande est devenue tellement considérable que les industriels allemands s&#8217;inquiètent beaucoup de la traduction en terme de compétitivité de l&#8217;industrie allemande. Nous même qui avons un super problème de compétitivité bien plus grave que celui des allemands est-ce que nous pouvons de ne pas exploiter nos ressources énergétiques qui nous permettraient de faire baisser la facture de nos industriels.</p>
<p>CLP : On a une électricité qui est très bon marché en France.</p>
<p>BC : C&#8217;est vrai. Grâce au nucléaire.</p>
<p>CLP : Oui, grâce au nucléaire mais elle est très bon marché. Qu&#8217;on paie pas notre prix, ça c&#8217;est une autre affaire, mais juste un mot pour dire, vous parlez des entreprises, juste un mot pour les particuliers, le ménage allemand paie le kW/h beaucoup plus cher que le ménage français mais paie une facture qui est moins chère que la facture du ménage français parce que l&#8217;efficacité énergétique en Allemagne c&#8217;est 35 % supérieur à l&#8217;efficacité énergétique en France.</p>
<p>ABQ : Pour que le tableau soit complet, le ménage allemand paie son énergie beaucoup plus cher que l&#8217;entreprise allemande. Donc ça m&#8217;amène à la question : en France qui doit payer la transition énergétique ? Le gouvernement vient d&#8217;annoncer qu&#8217;il va y avoir une fiscalité écologique qui va arriver. Qui doit payer ça ? Est-ce que ce sont les ménages, avec un risque sur leur pouvoir d&#8217;achat ou est-ce que ce sont les entreprises avec un risque sur la compétitivité ?</p>
<p>MV : François Hollande a dit que cette transition devait conduire la France à devenir une société sobre en carbone à l&#8217;horizon 2050.</p>
<p>&nbsp;</p>
<p>Il ne sera plus question de gaz de schiste pendant le reste de l&#8217;émission&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2013/01/04/prend-le-gaz-de-schiste-et-tire-toi/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://rf.proxycast.org/m/media/296096201420.mp3?c=culture&amp;amp" length="45" type="audio/mpeg" />
		</item>
		<item>
		<title>Happy New Year 2013</title>
		<link>http://eric.van-der-vlist.com/blog/2012/12/26/happy-new-year-2013/</link>
		<comments>http://eric.van-der-vlist.com/blog/2012/12/26/happy-new-year-2013/#comments</comments>
		<pubDate>Wed, 26 Dec 2012 13:00:46 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Personnel/Personal]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=799</guid>
		<description><![CDATA[I have chosen this picture because, beyond the beauty of this sunset above a flight of birds and Fort Boyard, has been taken after a very special day for me. Here are some other pictures that I could have chosen:]]></description>
				<content:encoded><![CDATA[<p><a href='http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux.jpg'><img src='http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux.jpg' alt='Carte de vœux' class='ngg-singlepic ngg-none size-full' /></a></p>
<p>I have chosen this picture because, beyond the beauty of this sunset above a flight of birds and <a href="http://en.wikipedia.org/wiki/Fort_Boyard_%28fortification%29" title="Fort Boyard on Wikipedia">Fort Boyard</a>, has been taken after a very special day for me.</p>
<p>Here are some other pictures that I could have chosen:</p>
<div class="ngg-galleryoverview" id="ngg-gallery-66-799">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-5137" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-00.jpg" title="Janvier 2012, Paris, île Saint-Louis et Notre Dame" class="shutterset_set_66" >
								<img title="Janvier 2012, Paris, île Saint-Louis et Notre Dame" alt="Janvier 2012, Paris, île Saint-Louis et Notre Dame" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-00.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5138" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-01.jpg" title="Février 2012, Prague, Mala Strana" class="shutterset_set_66" >
								<img title="Février 2012, Prague, Mala Strana" alt="Février 2012, Prague, Mala Strana" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-01.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5139" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-02.jpg" title="Mars 2012, Prunier" class="shutterset_set_66" >
								<img title="Mars 2012, Prunier" alt="Mars 2012, Prunier" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-02.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5140" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-03.jpg" title="Mars 2012, Jonquilles " class="shutterset_set_66" >
								<img title="Mars 2012, Jonquilles " alt="Mars 2012, Jonquilles " src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-03.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5141" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-04.jpg" title="Mai 2012, Iris" class="shutterset_set_66" >
								<img title="Mai 2012, Iris" alt="Mai 2012, Iris" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-04.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5142" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-05.jpg" title="Mai 2012, Faon de chevreuil" class="shutterset_set_66" >
								<img title="Mai 2012, Faon de chevreuil" alt="Mai 2012, Faon de chevreuil" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-05.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5143" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-06.jpg" title="Mai 2012, Épicéa bleu" class="shutterset_set_66" >
								<img title="Mai 2012, Épicéa bleu" alt="Mai 2012, Épicéa bleu" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-06.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5144" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-07.jpg" title="Mai 2012, Néflier" class="shutterset_set_66" >
								<img title="Mai 2012, Néflier" alt="Mai 2012, Néflier" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-07.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5145" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-08.jpg" title="Mai 2012, Sapin de Douglas" class="shutterset_set_66" >
								<img title="Mai 2012, Sapin de Douglas" alt="Mai 2012, Sapin de Douglas" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-08.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5146" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-09.jpg" title="Mai 2012, Rose" class="shutterset_set_66" >
								<img title="Mai 2012, Rose" alt="Mai 2012, Rose" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-09.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5147" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-10.jpg" title="Mai 2012, Visite de cigogne au Hameau Morel" class="shutterset_set_66" >
								<img title="Mai 2012, Visite de cigogne au Hameau Morel" alt="Mai 2012, Visite de cigogne au Hameau Morel" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-10.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5148" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-11.jpg" title="Juin 2012, Digitale" class="shutterset_set_66" >
								<img title="Juin 2012, Digitale" alt="Juin 2012, Digitale" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-11.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5149" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-12.jpg" title="Juillet 2012, Champignon" class="shutterset_set_66" >
								<img title="Juillet 2012, Champignon" alt="Juillet 2012, Champignon" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-12.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5150" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-13.jpg" title="Août 2012, Rose trémière" class="shutterset_set_66" >
								<img title="Rose trémière" alt="Rose trémière" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-13.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5151" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-14.jpg" title="Septembre 2912, Fouras" class="shutterset_set_66" >
								<img title="Septembre 2912, Fouras" alt="Septembre 2912, Fouras" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-14.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5152" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-15.jpg" title="Septembre 2912, Fouras" class="shutterset_set_66" >
								<img title="Septembre 2912, Fouras" alt="Septembre 2912, Fouras" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-15.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5153" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-16.jpg" title="Octobre 2012, Les Préaux, route du hameau Morel" class="shutterset_set_66" >
								<img title="Octobre 2012, Les Préaux, route du hameau Morel" alt="Octobre 2012, Les Préaux, route du hameau Morel" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-16.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5154" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-17.jpg" title="Novembre 2012, Triqueville, vue vers le Mont Crocq" class="shutterset_set_66" >
								<img title="Novembre 2012, Triqueville, vue vers le Mont Crocq" alt="Novembre 2012, Triqueville, vue vers le Mont Crocq" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-17.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5155" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux.jpg" title="Carte de vœux" class="shutterset_set_66" >
								<img title="Carte de vœux" alt="Carte de vœux" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class="ngg-clear"></div> 	
</div>

]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2012/12/26/happy-new-year-2013/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bonne année 2013</title>
		<link>http://eric.van-der-vlist.com/blog/2012/12/26/bonne-annee-2013/</link>
		<comments>http://eric.van-der-vlist.com/blog/2012/12/26/bonne-annee-2013/#comments</comments>
		<pubDate>Wed, 26 Dec 2012 13:00:38 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[Français]]></category>
		<category><![CDATA[Personnel/Personal]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=795</guid>
		<description><![CDATA[Cette photo me touche, outre le caractère spectaculaire du vol d&#8217;oiseaux devant le coucher de soleil sur Fort Boyard, parce qu&#8217;elle a été prise au soir d&#8217;un jour très particulier pour moi. Voici les photos auxquelles vous avez échappé cette &#8230; <a href="http://eric.van-der-vlist.com/blog/2012/12/26/bonne-annee-2013/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href='http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux.jpg'><img src='http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux.jpg' alt='Carte de vœux' class='ngg-singlepic ngg-none size-full' /></a></p>
<p>Cette photo me touche, outre le caractère spectaculaire du vol d&#8217;oiseaux devant le coucher de soleil sur <a href="http://fr.wikipedia.org/wiki/Fort_Boyard" title="For Boyard sur Wikipédia">Fort Boyard</a>, parce qu&#8217;elle a été prise au soir d&#8217;un jour très particulier pour moi.</p>
<p>Voici les photos auxquelles vous avez échappé cette année :</p>
<div class="ngg-galleryoverview" id="ngg-gallery-66-795">


	
	<!-- Thumbnails -->
		
	<div id="ngg-image-5137" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-00.jpg" title="Janvier 2012, Paris, île Saint-Louis et Notre Dame" class="shutterset_set_66" >
								<img title="Janvier 2012, Paris, île Saint-Louis et Notre Dame" alt="Janvier 2012, Paris, île Saint-Louis et Notre Dame" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-00.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5138" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-01.jpg" title="Février 2012, Prague, Mala Strana" class="shutterset_set_66" >
								<img title="Février 2012, Prague, Mala Strana" alt="Février 2012, Prague, Mala Strana" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-01.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5139" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-02.jpg" title="Mars 2012, Prunier" class="shutterset_set_66" >
								<img title="Mars 2012, Prunier" alt="Mars 2012, Prunier" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-02.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5140" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-03.jpg" title="Mars 2012, Jonquilles " class="shutterset_set_66" >
								<img title="Mars 2012, Jonquilles " alt="Mars 2012, Jonquilles " src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-03.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5141" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-04.jpg" title="Mai 2012, Iris" class="shutterset_set_66" >
								<img title="Mai 2012, Iris" alt="Mai 2012, Iris" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-04.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5142" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-05.jpg" title="Mai 2012, Faon de chevreuil" class="shutterset_set_66" >
								<img title="Mai 2012, Faon de chevreuil" alt="Mai 2012, Faon de chevreuil" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-05.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5143" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-06.jpg" title="Mai 2012, Épicéa bleu" class="shutterset_set_66" >
								<img title="Mai 2012, Épicéa bleu" alt="Mai 2012, Épicéa bleu" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-06.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5144" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-07.jpg" title="Mai 2012, Néflier" class="shutterset_set_66" >
								<img title="Mai 2012, Néflier" alt="Mai 2012, Néflier" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-07.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5145" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-08.jpg" title="Mai 2012, Sapin de Douglas" class="shutterset_set_66" >
								<img title="Mai 2012, Sapin de Douglas" alt="Mai 2012, Sapin de Douglas" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-08.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5146" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-09.jpg" title="Mai 2012, Rose" class="shutterset_set_66" >
								<img title="Mai 2012, Rose" alt="Mai 2012, Rose" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-09.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5147" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-10.jpg" title="Mai 2012, Visite de cigogne au Hameau Morel" class="shutterset_set_66" >
								<img title="Mai 2012, Visite de cigogne au Hameau Morel" alt="Mai 2012, Visite de cigogne au Hameau Morel" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-10.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5148" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-11.jpg" title="Juin 2012, Digitale" class="shutterset_set_66" >
								<img title="Juin 2012, Digitale" alt="Juin 2012, Digitale" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-11.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5149" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-12.jpg" title="Juillet 2012, Champignon" class="shutterset_set_66" >
								<img title="Juillet 2012, Champignon" alt="Juillet 2012, Champignon" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-12.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5150" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-13.jpg" title="Août 2012, Rose trémière" class="shutterset_set_66" >
								<img title="Rose trémière" alt="Rose trémière" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-13.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5151" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-14.jpg" title="Septembre 2912, Fouras" class="shutterset_set_66" >
								<img title="Septembre 2912, Fouras" alt="Septembre 2912, Fouras" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-14.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5152" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-15.jpg" title="Septembre 2912, Fouras" class="shutterset_set_66" >
								<img title="Septembre 2912, Fouras" alt="Septembre 2912, Fouras" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-15.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5153" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-16.jpg" title="Octobre 2012, Les Préaux, route du hameau Morel" class="shutterset_set_66" >
								<img title="Octobre 2012, Les Préaux, route du hameau Morel" alt="Octobre 2012, Les Préaux, route du hameau Morel" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-16.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5154" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux-17.jpg" title="Novembre 2012, Triqueville, vue vers le Mont Crocq" class="shutterset_set_66" >
								<img title="Novembre 2012, Triqueville, vue vers le Mont Crocq" alt="Novembre 2012, Triqueville, vue vers le Mont Crocq" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux-17.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-5155" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/voeux.jpg" title="Carte de vœux" class="shutterset_set_66" >
								<img title="Carte de vœux" alt="Carte de vœux" src="http://eric.van-der-vlist.com/blog/wp-content/gallery/voeux2013/thumbs/thumbs_voeux.jpg" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class="ngg-clear"></div> 	
</div>

]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2012/12/26/bonne-annee-2013/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Orbeon Forms, Tomcat and your application side by side on Ubuntu</title>
		<link>http://eric.van-der-vlist.com/blog/2012/10/18/installing-orbeon-forms-tomcat-and-your-application-side-by-side-on-ubuntu/</link>
		<comments>http://eric.van-der-vlist.com/blog/2012/10/18/installing-orbeon-forms-tomcat-and-your-application-side-by-side-on-ubuntu/#comments</comments>
		<pubDate>Thu, 18 Oct 2012 19:06:40 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[orbeon forms]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=777</guid>
		<description><![CDATA[One of the huge benefits of Debian based distributions (such as Ubuntu) is their packaging system that let you apply security updates on all the software that is installed on your system through a single command. It is a strong &#8230; <a href="http://eric.van-der-vlist.com/blog/2012/10/18/installing-orbeon-forms-tomcat-and-your-application-side-by-side-on-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>One of the huge benefits of Debian based distributions (such as Ubuntu) is their packaging system that let you apply security updates on all the software that is installed on your system through a single command.</p>
<p>It is a strong motivation to prefer to install software through distribution packages rather than from their developer downloads and that applies to tomcat which is a common choice as a servlet container to power Orbeon Forms applications.</p>
<p>The Orbeon Forms&#8217; <a href="http://wiki.orbeon.com/forms/doc/developer-guide/admin/installing">installation guide</a> describes two ways of installing on Tomcat. The <a href="http://wiki.orbeon.com/forms/doc/developer-guide/admin/installing#TOC-Apache-Tomcat">first one</a> is basically unzipping Orbeon Forms in the Tomcat&#8217;s webapp directory.</p>
<p>This is working fine, but rather than adding stuff to the <code>/var/lib/tomcat7/webapps</code> directory, I usually prefer to give Orbeon Forms its own location and use the second method &#8220;<a href="http://wiki.orbeon.com/forms/doc/developer-guide/admin/installing#TOC-Apache-Tomcat-with-a-custom-context">Apache Tomcat with a custom context</a>&#8220;. If you are using the tomcat7 Ubuntu or Debian package, the context file (that can be called <code>orbeon.xml</code>) should go in the <code>/etc/tomcat7/Catalina/localhost/</code> directory.</p>
<p>On my laptop, with Ubuntu 12.04 and Tomcat7, this configuration is working out of the box.</p>
<p>Now that we&#8217;ve installed Orbeon Forms physically &#8220;side by side&#8221; with Tomcat rather than within a Tomcat directory, what about installing your Orbeon Forms application side by side with Orbeon Forms rather than installing into the Orbeon Forms directories?</p>
<p>This is also possible using Orbeon Forms <a href="wiki.orbeon.com/forms/doc/developer-guide/resource-managers">resource managers</a>! This is a technique that is used in development mode and in web.xml you can find the following comment:</p>
<pre class="brush:xml">    &lt;!-- Uncomment this for the filesystem resource manager (development mode) --&gt;
    &lt;!--
    &lt;context-param&gt;
        &lt;param-name&gt;oxf.resources.priority.1&lt;/param-name&gt;
        &lt;param-value&gt;org.orbeon.oxf.resources.FilesystemResourceManagerFactory&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;context-param&gt;
        &lt;param-name&gt;oxf.resources.priority.1.oxf.resources.filesystem.sandbox-directory&lt;/param-name&gt;
        &lt;param-value&gt;/home/teamcity/TeamCity/buildAgent/work/278cc758fa087cef/src/resources&lt;/param-value&gt;
    &lt;/context-param&gt;--&gt;
    &lt;!-- End filesystem resource manager (development mode) --&gt;</pre>
<p>The context parameters that are commented basically say that resources will be searched in a specific directory (such as <code>/home/teamcity/TeamCity/buildAgent/work/278cc758fa087cef/src/resources</code>) before being searched in the Orbeon Forms <code>WEB-INF/resource</code> directory (which itself will be used before searching in the packages jar files, &#8230;).</p>
<p>To deploy your application side by side with the Orbeon Forms installation you can just uncomment these parameters and replace this directory by the location of your application. The documents that you&#8217;ll provide in this directory will then override the documents that might be in the Orbeon Forms installation.</p>
<p>There is probably a performance degradation associated with this mechanism but the benefits are really interesting: <code>web.xml</code> becomes the only file that you&#8217;ll update in the standard Orbeon Forms installation and changing Orbeon Forms versions becomes really easy.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2012/10/18/installing-orbeon-forms-tomcat-and-your-application-side-by-side-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tout est à nous</title>
		<link>http://eric.van-der-vlist.com/blog/2012/09/30/tout-est-a-nous/</link>
		<comments>http://eric.van-der-vlist.com/blog/2012/09/30/tout-est-a-nous/#comments</comments>
		<pubDate>Sun, 30 Sep 2012 17:53:58 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[Français]]></category>
		<category><![CDATA[Society/Societe]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=773</guid>
		<description><![CDATA[Tout est à nous Rien n’est à eux Tout ce qu’ils ont Ils l’ont volé Partage des richesses Partage du temps de travail Ou sinon ça va péter Cet après midi encore, cette chanson de manif m&#8217;a ému. Elle est &#8230; <a href="http://eric.van-der-vlist.com/blog/2012/09/30/tout-est-a-nous/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<blockquote><p>Tout est à nous<br />
Rien n’est à eux<br />
Tout ce qu’ils ont<br />
Ils l’ont volé<br />
Partage des richesses<br />
Partage du temps de travail<br />
Ou sinon ça va péter</p></blockquote>
<p><a href="http://www.mouvementutopia.org/blog/index.php?post/2012/09/28/Communique-de-presse-NON-AU-TRAITE-EUROPEEN-OUI-A-UN-REFERENDUM">Cet après midi</a> encore, cette chanson de manif m&#8217;a ému. Elle est simple et peut paraître naïve. Elle résume pourtant parfaitement la crise économique et écologique que nous traversons.</p>
<p>Cela fait des années qu&#8217;elle est scandée manif après manif. Si tant de monde partage ce constat, pourquoi rien ne change t-il?</p>
]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2012/09/30/tout-est-a-nous/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Toward χίμαιραλ/superset</title>
		<link>http://eric.van-der-vlist.com/blog/2012/08/08/toward-%cf%87%ce%af%ce%bc%ce%b1%ce%b9%cf%81%ce%b1%ce%bbsuperset/</link>
		<comments>http://eric.van-der-vlist.com/blog/2012/08/08/toward-%cf%87%ce%af%ce%bc%ce%b1%ce%b9%cf%81%ce%b1%ce%bbsuperset/#comments</comments>
		<pubDate>Wed, 08 Aug 2012 18:15:48 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[balisage]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[xdm]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=726</guid>
		<description><![CDATA[Background Up to now, my approach to explore possible solutions to support JSON in XDM has been to evaluate the proposal to introduce maps in XSLT 3.0, leading to the χίμαιραλ proposal. Finding out that in the current XSLT 3.0 &#8230; <a href="http://eric.van-der-vlist.com/blog/2012/08/08/toward-%cf%87%ce%af%ce%bc%ce%b1%ce%b9%cf%81%ce%b1%ce%bbsuperset/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h3>Background</h3>
<p>Up to now, my approach to explore possible solutions to support JSON in XDM has been to evaluate the proposal to introduce maps in XSLT 3.0, leading to the <a href="http://χίμαιραλ.com">χίμαιραλ</a> proposal.</p>
<p>Finding out that in the <a href="http://www.w3.org/TR/2012/WD-xslt-30-20120710/#map">current XSLT 3.0 Working Draft</a>, JSON objects would be <a href="http://dyomedea.com/papers/2012-balisage/#/step-36">second class XDM citizens</a>, I think that it&#8217;s worth considering other approaches and consider <a href="http://www.balisage.net/Proceedings/vol8/html/Rennau01/BalisageVol8-Rennau01.html">Jürgen Rennau&#8217;s UDL proposal</a> has a very good starting point.</p>
<p>In their comments after Rennau&#8217;s presentation, John Cowan and Steven DeRose stressed out the need to forget about the serialization and focus on the data model, at least as a first step, when proposing alternative solutions.</p>
<p>Following their advise, I&#8217;d like to propose an update to <a href="http://www.w3.org/TR/xpath-datamodel-30/">core XDM 3.0</a> that would natively support JSON objects without introducing any new item kind.</p>
<p>Because this proposal is a chimera and because it&#8217;s a superset of the current XDM (any current XDM instance would be compatible with the updates I am proposing), I&#8217;ll call this proposal χίμαιραλ/superset.</p>
<p>The XDM carefully avoids to draw class models and prefers to specify nodes through nodes kinds and accessors. However, I think fair to say that elements are defined as nodes with three basic properties:</p>
<ul>
<li>A mandatory name which is a QName.</li>
<li>A map of attributes which keys are QName.</li>
<li>An array of children nodes.</li>
</ul>
<p>On the other hand, the JSON data model is composed of arrays, objects and atomic values. JSON atomic values can be numbers, strings, booleans or null. JSON key arrays can be any atomic values.</p>
<p>Traditional approaches to bind JSON and XML use XML element&#8217;s children to represent JSON object properties and UDL is no different in that matter.</p>
<p>There are obvious good reasons to do, the main one being that XML attribute values can only be atomic values while JSON object properties can also be maps or arrays.</p>
<p>However, the end result is that the interface mismatch resulting from binding JSON objects (which are maps) into XML children (which are arrays) is at the origin of most of the complexity of these proposals.</p>
<h3>Proposal ( χίμαιραλ/superset)</h3>
<p>Since XML elements already have both a map (of attributes) and an array (of children nodes), why not use these native features to bind JSON maps and arrays and just update the data model to remove the restrictions that make attribute maps and children arrays unfit for being bound respectively to JSON objects and arrays?</p>
<p>A JSON object would then just be bound to an XML element with attributes and without children nodes and a JSON array would be bound to an XML element with children nodes and without attribute.</p>
<p>This seems especially easy if we focus on the data model and postpone the (optional) definition of a serialization syntax.</p>
<h4>First modification: elements can be anonymous</h4>
<p>Neither JSON objects nor JSON arrays have name but XML elements have names and this name is mandatory.</p>
<p>To fix this issue, element names should become optional (in other words, we introduce the notion of anonymous elements).</p>
<h4>Second modification: attribute names should also possibly be strings, booleans or null</h4>
<p>If we bind JSON object keys on attribute names, it should be possible to use all the basic types that JSON accept for its keys.</p>
<p>Additionally, we may want to consider supporting other XML Schema simple types, possibly each of them.</p>
<p>To make this possible, the definition of the<a href="http://www.w3.org/TR/xpath-datamodel-30/#dm-node-name"> dm:node-name()</a> accessor should be updated to return a typed values rather than a QName. This modification should concern attribute nodes at minima but for maximum homogeneity, we should probably extend that to other node types.</p>
<h4>Third and last modification: attributes should have (optional) attributes and children</h4>
<p>JSON object values can be objects and arrays and since objects are bound to attributes and arrays are bound to children, attributes should support both.</p>
<h4>Mapping JSON into χίμαιραλ/superset</h4>
<p>With these updates, binding JSON into XML become quite straightforward:</p>
<ul>
<li>A JSON object is mapped into an anonymous element without children and one attribute per key/value pair.</li>
<li>A JSON array is mapped into an anonymous element without attribute and a child element per item.</li>
</ul>
<p>Let&#8217;s take the now famous (at least on this blog) JSON snippet borrowed from the XSLT 3.0 Working Draft:</p>
<pre class="brush: js">{ "accounting" : [
      { "firstName" : "John",
        "lastName"  : "Doe",
        "age"       : 23 },

      { "firstName" : "Mary",
        "lastName"  : "Smith",
        "age"       : 32 }
                 ],                                
  "sales"     : [
      { "firstName" : "Sally",
        "lastName"  : "Green",
        "age"       : 27 },

      { "firstName" : "Jim", 
        "lastName"  : "Galley",
        "age"       : 41 }
                  ]
}</pre>
<p>Becomes:</p>
<ul>
<li>Anonymous element without children and two attributes:
<ul>
<li>Attribute &#8220;accounting&#8221; (as a string) with no attributes and the two following children:
<ul>
<li>Anonymous element with no children and the three following attributes:
<ul>
<li>Attribute &#8220;firstName&#8221; (as a string) and a value &#8220;John&#8221; (as a string)</li>
<li>Attribute &#8220;lastName&#8221; (as a string) and a value &#8220;Doe&#8221; (as a string)</li>
<li>Attribute &#8220;age&#8221; (as a string) and a value 23 (as a number)</li>
</ul>
</li>
<li>Anonymous element with no children and the three following attributes:
<ul>
<li>Attribute &#8220;firstName&#8221; (as a string) and a value &#8220;Mary&#8221; (as a string)</li>
<li>Attribute &#8220;lastName&#8221; (as a string) and a value &#8220;Smith&#8221; (as a string)</li>
<li>Attribute &#8220;age&#8221; (as a string) and a value 32 (as a number)</li>
</ul>
</li>
</ul>
</li>
<li>Attribute &#8220;sales&#8221; (as a string) with no attributes and the two following children:
<ul>
<li>Anonymous element with no children and the three following attributes:
<ul>
<li>Attribute &#8220;firstName&#8221; (as a string) and a value &#8220;Sally&#8221; (as a string)</li>
<li>Attribute &#8220;lastName&#8221; (as a string) and a value &#8220;Green&#8221; (as a string)</li>
<li>Attribute &#8220;age&#8221; (as a string) and a value 27 (as a number)</li>
</ul>
</li>
<li>Anonymous element with no children and the three following attributes:
<ul>
<li>Attribute &#8220;firstName&#8221; (as a string) and a value &#8220;Jim&#8221; (as a string)</li>
<li>Attribute &#8220;lastName&#8221; (as a string) and a value &#8220;Galley&#8221; (as a string)</li>
<li>Attribute &#8220;age&#8221; (as a string) and a value 41 (as a number)</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>What do you think (comments very welcome)!</p>
]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2012/08/08/toward-%cf%87%ce%af%ce%bc%ce%b1%ce%b9%cf%81%ce%b1%ce%bbsuperset/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fleshing the XDM chimera</title>
		<link>http://eric.van-der-vlist.com/blog/2012/08/08/fleshing-the-xdm-chimera/</link>
		<comments>http://eric.van-der-vlist.com/blog/2012/08/08/fleshing-the-xdm-chimera/#comments</comments>
		<pubDate>Wed, 08 Aug 2012 04:06:11 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[balisage]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[xdm]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=706</guid>
		<description><![CDATA[Note: this article is derived from the presentation I have given at Balisage (precedings). See also the slides (and video) used during this presentation. Abstract The XQuery and XPath Data Model 3.0 (XDM) is the kernel of the XML ecosystem. &#8230; <a href="http://eric.van-der-vlist.com/blog/2012/08/08/fleshing-the-xdm-chimera/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="article">
<div class="titlepage">
<div>
<div>
<div class="abstract">
<p class="title"><em>Note: this article is derived from <a href="http://balisage.net/2012/Program.html#t200p">the presentation</a> I have given at Balisage (<a href="http://balisage.net/Proceedings/vol8/html/Vlist01/BalisageVol8-Vlist01.html">precedings</a>). See also the <a href="http://dyomedea.com/papers/2012-balisage/">slides</a> (and <a href="http://dyomedea.com/papers/2012-balisage/#/video">video</a>) used during this presentation.<br />
</em></p>
<p class="title"><strong>Abstract</strong></p>
<p>The XQuery and XPath Data Model 3.0 (XDM) is the kernel of the XML ecosystem. XDM had been extended with foreign item types to embrace new data sources such as JSON, taking the risk to become a chimera. This talk explores some ways to move this fundamental piece of the XML stack forward.</p>
</div>
</div>
</div>
<hr />
</div>
<div class="toc">
<p><strong>Table of Contents</strong></p>
<dl>
<dt><span class="section"><a href="#d5e19">Motivation</a></span></dt>
<dt><span class="section"><a href="#d5e57">XML Data Models</a></span></dt>
<dd>
<dl>
<dt><span class="section"><a href="#d5e62">XPath/XSLT 1.0</a></span></dt>
<dt><span class="section"><a href="#d5e81">XDML 2.0: XPath 2.0/XSLT 2.0/XQuery 1.0</a></span></dt>
<dt><span class="section"><a href="#d5e117">XDM 3.0: XPath 3.0/XSLT 3.0/XQuery 3.0</a></span></dt>
</dl>
</dd>
<dt><span class="section"><a href="#d5e138">Identity Crisis</a></span></dt>
<dt><span class="section"><a href="#d5e221">Introducing χίμαιραλ (chimeral), the Chimera Language</a></span></dt>
<dd>
<dl>
<dt><span class="section"><a href="#d5e227">Example</a></span></dt>
<dt><span class="section"><a href="#d5e234">χίμαιραλ In a Nutshell</a></span></dt>
<dt><span class="section"><a href="#d5e287">Remaining Issues</a></span></dt>
<dt><span class="section"><a href="#d5e294">χίμαιραλ and the identity crisis</a></span></dt>
</dl>
</dd>
<dt><span class="section"><a href="#d5e304">Moving the chimera forward</a></span></dt>
<dd>
<dl>
<dt><span class="section"><a href="#d5e309">Embracing RDF</a></span></dt>
<dt><span class="section"><a href="#d5e321">Syntactical sugar</a></span></dt>
<dt><span class="section"><a href="#d5e348">XPath</a></span></dt>
<dt><span class="section"><a href="#d5e365">Validation</a></span></dt>
</dl>
</dd>
<dt><span class="section"><a href="#d5e384">Conclusion</a></span></dt>
</dl>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e19"></a>Motivation</h2>
</div>
</div>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%"><a class="link" href="http://en.wikipedia.org/wiki/Chimera_%28mythology%29" target="_blank">Chimera (mythology)</a>: The Chimera (also Chimaera or Chimæra) (Greek: Χίμαιρα, Khimaira, from χίμαρος, khimaros, &#8220;she-goat&#8221;) was, according to Greek mythology, a monstrous fire-breathing female creature of Lycia in Asia Minor, composed of the parts of multiple animals: upon the body of a lioness with a tail that ended in a snake&#8217;s head, the head of a goat arose on her back at the center of her spine. The Chimera was one of the offspring of Typhon and Echidna and a sibling of such monsters as Cerberus and the Lernaean Hydra. The term chimera has also come to describe any mythical animal with parts taken from various animals and, more generally, an impossible or foolish fantasy.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution"><a class="link" href="http://en.wikipedia.org/wiki/Chimera_%28mythology%29" target="_blank">Wikipedia</a></span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%"><a class="link" href="http://en.wikipedia.org/wiki/Chimera_%28genetics%29" target="_blank">Chimera (genetics)</a>: A chimera or chimaera is a single organism (usually an animal) that is composed of two or more different populations of genetically distinct cells that originated from different zygotes involved in sexual reproduction. If the different cells have emerged from the same zygote, the organism is called a mosaic. Chimeras are formed from at least four parent cells (two fertilized eggs or early embryos fused together). Each population of cells keeps its own character and the resulting organism is a mixture of tissues.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution"><a class="link" href="http://en.wikipedia.org/wiki/Chimera_%28genetics%29" target="_blank">Wikipedia</a></span></td>
</tr>
</tbody>
</table>
</div>
<p>During her opening keynote at XML Prague 2012, speaking about the relation between XML, HTML, JSON and RDF, Jeni Tennison warned us against the temptation to create chimeras: [<span class="citation">chimera are usually ugly, foolish or impossible fantasies</span>].</p>
<p>The next morning, Michael Kay and Jonathan Robie came to present new features in XPath/XQuery/XSLT 3.0. A lot of these features are directly based on the XQuery and XPath Data Model 3.0 (aka <a class="link" href="http://www.w3.org/TR/2011/WD-xpath-datamodel-30-20111213/#other-items" target="_blank">XDM</a>):</p>
<div class="blockquote">
<blockquote class="blockquote"><p>The XPath Data Model is the abstraction over which XPath expressions are evaluated. Historically, all of the items in the data model could be derived directly (nodes) or indirectly (typed values, sequences) from an XML document. However, as the XPath expression language has matured, new features have been added which require additional types of items to appear in the data model. These items have no direct XML serialization, but they are never the less part of the data model.</p></blockquote>
</div>
<p>XDM 3.0 is composed of items from a number of different technologies:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">Items from the XML Infoset (nodes, attributes, &#8230;)</li>
<li class="listitem">Datatype information borrowed from the Post Schema Validation Infoset</li>
<li class="listitem">Sequences</li>
<li class="listitem">Atomic values</li>
<li class="listitem">Functions that can also be used to model JSON arrays</li>
</ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<table summary="Note" border="0">
<tbody>
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/note.png" alt="A note" /></td>
<th align="left">Note</th>
</tr>
<tr>
<td align="left" valign="top">The feature that will be introduced to model JSON arrays is called &#8220;maps&#8221; and it will be specified as a XSLT feature in the XSLT 3.0 recommendation (not published yet). The XSLT 3.0 editor, Michael Kay has published an <a class="link" href="http://dev.saxonica.com/blog/mike/2012/01/#000188" target="_blank">early version</a> of this feature in his blog. In this paper, XDM 3.0 will refer to the XSLT 3.0 data model (the XPath 3.0 data model augmented with maps).</td>
</tr>
</tbody>
</table>
</div>
<p>XDM 3.0 being a single data model composed of items from different data models, it is fair to say that it is a chimera!</p>
<p>Following Jeni Tennison on stage, I have tried to <a class="link" href="http://eric.van-der-vlist.com/blog/owark/912" target="_blank">show</a> that in a world where HTML 5 on one hand and JSON on the other hand are gaining traction, XML has become an ecosystem in a competitive environment and that it&#8217;s data model is a major competitive advantage.</p>
<p>Among other factors, the continued success of XML will thus come from its ability to seamlessly integrate other data models such as JSON.</p>
<p>If we follow this conclusion, we must admit that this chimera is essential to the future of XML and do our best to make it elegant and smart.</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e57"></a>XML Data Models</h2>
</div>
</div>
</div>
<p>Whether it&#8217;s a bug or a feature could be debated endlessly, but a remarkable feature of the XML recommendation it&#8217;s all about syntax and parsing rule and does not really define a data model. The big advantage is that everyone can find pretty much what he wants in XML documents but for the sake of this paper we need to choose a well known -and well defined- data model to work on.</p>
<p>The most common XML data model is probably the data model defined by the trio XPath/XSLT/XQuery known as &#8220;XDM&#8221; since XPath version 2.0 and that&#8217;s the one we will choose.</p>
<p>XDM version 3.0, still work in progress, will be the third version of this data model. It&#8217;s important to understand its design and evolution to use its most advanced features and we&#8217;ll start our prospective by a short history of its versions.</p>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e62"></a>XPath/XSLT 1.0</h3>
</div>
</div>
</div>
<p>The <a class="link" href="http://www.w3.org/TR/xpath/#data-model" target="_blank">XPath 1.0 data model</a> is described as being composed of seven types of nodes (root, elements, text, attributes, namespaces, processing instructions and comments).</p>
<p>The <a class="link" href="http://www.w3.org/TR/xslt/#data-model" target="_blank">XSLT 1.0 data model</a> is defined as being the XPath 1.0 data model with:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">Relaxed constraints on root node children to support well-formed external general parsed entities that are not well formed XML documents</li>
<li class="listitem">An additional &#8220;base URI&#8221; property on every node.</li>
<li class="listitem">An additional &#8220;unparsed entities&#8221; property on the root node.</li>
</ul>
</div>
<p>It&#8217;s fair to say that these two -very close- data models are completely focused on XML, but is that all?</p>
<p>Not entirely and these two specifications introduce other notions that should be considered as related to the data model even if they are not described in their sections called &#8220;Data Model&#8221;&#8230;</p>
<p>XSLT 1.0 inadvertently mentions <span class="quote">“<span class="quote">the four basic XPath data-types (string, number, boolean, node-set)</span>”</span> to explicitly add a fifth one: <span class="quote">“<span class="quote">result tree</span></span> fragments”.</p>
<p>These four basic data-types are implicitly defined in XPath 1.0 in its section about its function library but no formal description of these types is given.</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e81"></a>XDML 2.0: XPath 2.0/XSLT 2.0/XQuery 1.0</h3>
</div>
</div>
</div>
<p>In version 2.0, the XDM is promoted to get its <a class="link" href="http://www.w3.org/TR/xpath-datamodel/" target="_blank">own specification</a>.</p>
<p>XDM 2.0 keeps the same seven types of nodes as XPath 1.0 and integrates the additions from the XSLT 1.0 data model. A number of properties are added to these nodes to capture information that had been left outside the data model by the previous version and also to support the data-type system from the PSVI (Post Schema Validation Infoset).</p>
<p>The term &#8220;data-type&#8221; or simply &#8220;type&#8221; being now used to refer to XML Schema data-types, a new terminology is introduced where the data model is composed of &#8220;information items&#8221; (or items) being either XML nodes or &#8220;atomic values&#8221;.</p>
<p>The concept of &#8220;sequences&#8221; is also introduced. Sequences are not strictly considered as items but play a very important role in XDM. They are defined as <span class="quote">“<span class="quote">an ordered collection</span></span> of zero or more <a class="link" href="http://www.w3.org/TR/xpath-datamodel/#dt-item" target="_blank">items</a>”.</p>
<p>The data model is thus now composed of three different concepts:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">nodes</li>
<li class="listitem">atomic values</li>
<li class="listitem">sequences</li>
</ul>
</div>
<p>XDM 2.0 notes that an important difference between nodes and atomic values is that only nodes have <a class="link" href="http://www.w3.org/TR/xpath-datamodel/#node-identity" target="_blank">identities</a>:</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Each node has a unique identity. Every <a class="link" href="http://www.w3.org/TR/xpath-datamodel/#dt-node" target="_blank">node</a> in an instance of the data model is unique: identical to itself, and not identical to any other node. (<a class="link" href="http://www.w3.org/TR/xpath-datamodel/#dt-atomic-value" target="_blank">Atomic values</a> do not have identity; every instance of the value “5” as an integer is identical to every other instance of the value “5” as an integer.)</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution"><a class="link" href="http://www.w3.org/TR/xpath-datamodel/#node-identity" target="_blank">XQuery 1.0 and XPath 2.0 Data Model (XDM) (Second Edition)</a></span></td>
</tr>
</tbody>
</table>
</div>
<p>This is a crucial distinction that divides the data model into two different kind of items (those which have an identity and those which haven&#8217;t one). Let&#8217;s take an example:</p>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;root&gt;
    &lt;foo&gt;5&lt;/foo&gt;
    &lt;foo&gt;5&lt;/foo&gt;
    &lt;bar foo="5"&gt;
        &lt;foo&gt;5&lt;/foo&gt;
    &lt;/bar&gt;
&lt;/root&gt;</pre>
<p>The three <code class="code">&lt;foo&gt;5&lt;/foo&gt;</code> look similar and can be considered &#8220;<a class="link" href="http://www.w3.org/TR/xpath-functions/#func-deep-equal" target="_blank">deeply equal</a>&#8221; but they are three different elements with three different identities. This is needed because some of their properties are different: the parent of the first two is <code class="code">&lt;root/&gt;</code> while the parent of the third one is <code class="code">&lt;bar/&gt;</code>, the preceding sibling of the second one is the first one while the first one has no preceeding sibling, &#8230;</p>
<p>The three &#8220;5&#8243; text nodes are similar but they still are different text nodes with different identities and this is necessary because they don&#8217;t have the same parent elements.</p>
<p>By contrast, the atomic values of the three <code class="code">&lt;foo/&gt;</code> element (and the atomic value of the <code class="code">@foo</code> attribute) are the same atomic value, the &#8220;5&#8243; (assuming they have all been declared with the same datatype). Among many other things, this means that when you manipulate their values, you can&#8217;t access back to the node that is holding the value).</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e117"></a>XDM 3.0: XPath 3.0/XSLT 3.0/XQuery 3.0</h3>
</div>
</div>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<table summary="Note" border="0">
<tbody>
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/note.png" alt="A note" /></td>
<th align="left">Note</th>
</tr>
<tr>
<td align="left" valign="top">These specifications are still work on progress, currently divided between <a class="link" href="http://www.w3.org/TR/2011/WD-xpath-datamodel-30-20111213/" target="_blank">XQuery and XPath Data</a> Model 3.0and data model extensions described in XSL Transformations (XSLT) Version 3.0.</td>
</tr>
</tbody>
</table>
</div>
<p>XDM 3.0 adds functions as a third kind of items, transforming XQuery and XSLT into functional languages.</p>
<p>Like atomic values, functions have no identity:</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Functions have no identity, cannot be compared, and have no serialization.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution"><a class="link" href="http://www.w3.org/TR/2011/WD-xpath-datamodel-30-20111213/#function-items" target="_blank">XQuery and XPath Data Model 3.0 &#8211; W3C Working Draft 13 December</a></span></p>
<p>2011</td>
</tr>
</tbody>
</table>
</div>
<p>XSLT 3.0 adds to XDM 3.0 a fourth king of items: maps, derived from functions which, among many other use cases, can be used to model JSON objects:</p>
<p>Like atomic values and functions (from which they are derived), maps have no identity:</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Like sequences, maps have no identity. It is meaningful to compare the contents of two maps, but there is no way of asking whether they are &#8220;the same map&#8221;: two maps with the same content are indistinguishable.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution"><a class="link" href="http://www.w3.org/TR/xslt-30/#map" target="_blank">XSL Transformations (XSLT) Version 3.0 &#8211; W3C Working Draft 10 July 2012</a></span></td>
</tr>
</tbody>
</table>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<table summary="Note" border="0">
<tbody>
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/note.png" alt="A note" /></td>
<th align="left">Note</th>
</tr>
<tr>
<td align="left" valign="top">In this statement, the specification does acknowledge that sequences have no identity either. This is understandable but didn&#8217;t seem to be clearly specified elsewhere.</td>
</tr>
</tbody>
</table>
</div>
<p>Of course, XSLT 3.0 is also adding functions to create, manipulate maps and serialize/deserialize them as JSON and a syntax to define map literals. It does not any new pattern to select of match maps or map entries, though.</p>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e138"></a>Identity Crisis</h2>
</div>
</div>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Appolonius&#8217; ship is a beautiful ship. Over the years it has been repaired so many times that there is not a single piece of the original materials remaining. The question is, therefore, is it really still Appolonius&#8217; ship?</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution"><a class="link" href="http://c2.com/cgi/wiki?ObjectIdentity" target="_blank">ObjectIdentity on c2.com</a></span></td>
</tr>
</tbody>
</table>
</div>
<p>Object identity is often confused with mutability. The need for objects to have identities is more obvious when they are mutable, their identities being then used to track them despite their changes like Appolonius&#8217; ship. However, XDM 3.0 gives us a good opportunity to explore the meaning and consequences of having (or not having) an identity for immutable object structures.</p>
<p>The definition of node identity in XDM 3.0 is directly copied from XDM 2.0:</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Each node has a unique identity. Every <a class="link" href="http://www.w3.org/TR/2011/WD-xpath-datamodel-30-20111213/#dt-node" target="_blank">node</a> in an instance of the data model is unique: identical to itself, and not identical to any other node. (<a class="link" href="http://www.w3.org/TR/2011/WD-xpath-datamodel-30-20111213/#dt-atomic-value" target="_blank">Atomic values</a> do not have identity; every instance of the value “5” as an integer is identical to every other instance of the value “5” as an integer.)</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution"><a class="link" href="http://www.w3.org/TR/2011/WD-xpath-datamodel-30-20111213/#node-identity" target="_blank">XQuery and XPath Data Model 3.0 &#8211; W3C Working Draft 13 December</a></span> 2011</td>
</tr>
</tbody>
</table>
</div>
<p>I find this definition confusing:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">Why should the value “5” as an integer be instantiated and why should we care? The value “5” as an integer is&#8230; the value “5” as an integer! It&#8217;s unique and being unique, doesn&#8217;t it have an identity?</li>
<li class="listitem">A node, with all the properties defined in XDM (including its document-uri and parent accessors) would be unique if it had &#8220;previous-sibling&#8221; or &#8220;document-order&#8221; accessors.</li>
</ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<table summary="Note" border="0">
<tbody>
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/note.png" alt="A note" /></td>
<th align="left">Note</th>
</tr>
<tr>
<td align="left" valign="top">To find the previous siblings of a node relying only on the accessors defined in XDM (2.0 or 3.0), you&#8217;d have to access to the node&#8217;s parent and loop over it&#8217;s children until you find the current node that you would identify as such by checking its identity.</td>
</tr>
</tbody>
</table>
</div>
<p>Rather than focussing on uniqueness, which for immutable information items does not really matter, a better differentiation could be between information items which have enough context information to &#8220;know where they belong&#8221; in the data model and those which don&#8217;t.</p>
<p>This differentiation has the benefit of highlighting the consequences of having or not having an identity: to be able to navigate between an information item and its ancestors or sibling this item must know where it belongs. When that&#8217;s not the case, it is still be possible to navigate between the item and its descendants but axis such as <code class="code">ancestor::</code> or<code class="code"> sibling::</code> are not available.</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<table summary="Note" border="0">
<tbody>
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/note.png" alt="A note" /></td>
<th align="left">Note</th>
</tr>
<tr>
<td align="left" valign="top">Identity can be seen as the price to pay for the <code class="code">ancestor::</code> and <code class="code">sibling::</code> axis.</td>
</tr>
</tbody>
</table>
</div>
<p>Let&#8217;s take back a simple example:</p>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;root&gt;
    &lt;foo&gt;5&lt;/foo&gt;
    &lt;foo&gt;5&lt;/foo&gt;
    &lt;bar&gt; 
        &lt;foo&gt;5&lt;/foo&gt;
    &lt;/bar&gt;
&lt;/root&gt;</pre>
<p>In an hypothetical data model where nodes have no identity, there would be only 3 elements:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">The root element</li>
<li class="listitem">The bar element</li>
<li class="listitem">The foo element (referred twice has children of root end once as child of bar)</li>
</ul>
</div>
<p>If we add identity (or context information) properties, the foo elements become three information different items since they defer by these properties.</p>
<p>The process of adding these properties to an information item looks familiar. Depending on your background, you can compare it to:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">class/object instantiation in class based Object Oriented Programming</li>
<li class="listitem">clones in prototype based Object Oriented Programming</li>
<li class="listitem">RDF reification.</li>
</ul>
</div>
<p>We&#8217;ve seen that XDM 3.0 acknowledges this difference between information items which have context information and those which don&#8217;t have. I don&#8217;t want to deny that both types of data models have their use cases: there are obviously many use cases where context information is needed and use cases where lightweight structures are a better fit.</p>
<p>That being said, if we are serious about the support of JSON in XDM, we should offer the same features to access data whether this data is stored in maps or in XML nodes.</p>
<p>Let&#8217;s consider this JSON object borrowed from the XSLT 3.0 Working Draft:</p>
<pre class="programlisting brush: js">{ "accounting" : [ 
      { "firstName" : "John", 
        "lastName"  : "Doe",
        "age"       : 23 },

      { "firstName" : "Mary", 
        "lastName"  : "Smith",
        "age"       : 32 }
                 ],                                 
  "sales"     : [ 
      { "firstName" : "Sally", 
        "lastName"  : "Green",
        "age"       : 27 },

      { "firstName" : "Jim",  
        "lastName"  : "Galley",
        "age"       : 41 }
                  ]
}</pre>
<p>This object could be represented in XML by the following document:</p>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;company&gt;
    &lt;department name="sales"&gt;
        &lt;employee&gt;
            &lt;firstName&gt;Sally&lt;/firstName&gt;
            &lt;lastName&gt;Green&lt;/lastName&gt;
            &lt;age&gt;27&lt;/age&gt;
        &lt;/employee&gt;
        &lt;employee&gt;
            &lt;firstName&gt;Jim&lt;/firstName&gt;
            &lt;lastName&gt;Galley&lt;/lastName&gt;
            &lt;age&gt;41&lt;/age&gt;
        &lt;/employee&gt;
    &lt;/department&gt;
    &lt;department name="accounting"&gt;
        &lt;employee&gt;
            &lt;firstName&gt;John&lt;/firstName&gt;
            &lt;lastName&gt;Doe&lt;/lastName&gt;
            &lt;age&gt;23&lt;/age&gt;
        &lt;/employee&gt;
        &lt;employee&gt;
            &lt;firstName&gt;Mary&lt;/firstName&gt;
            &lt;lastName&gt;Smith&lt;/lastName&gt;
            &lt;age&gt;32&lt;/age&gt;
        &lt;/employee&gt;
    &lt;/department&gt;
&lt;/company&gt;</pre>
<p>The features introduced in the latest XSLT 3.0 Working Draft do allow to transform rather easily from one model to the other, but these two models do not have, bar far, the same features.</p>
<p>In the XML flavor, when the context item is the employee &#8220;John Doe&#8221;, you can easily find out what his department is because this is an element and element do carry context information.</p>
<p>In the map flavor by contrast when the context item is an employee map, this object has no context information and you can&#8217;t tell which is his department without looping within the containing map.</p>
<p>This important restriction is at a purely data model level. It is aggravated by the XPath syntax has not been extended to generalize axis so that they can work with maps. If I work with the XML version of this structure, it&#8217;s obvious to evaluate things such as the number of employees, the average age of employees, the number of departments, the number of employees by department, the average age by department, obvious to find out if there is an employee called &#8220;Mary Smith&#8221; in one of the departments, the employees who are more than 40, to get a list of employees from all the department sorted by age, &#8230; In the map flavor by contrast, I don&#8217;t have any XPath axis available and must do all these operations using a limited number of map functions (map:keys(), map:contains(), map:get()). In other words, while I can use XPath expressions with the XML version, I must use DOM like operations to access the map version!</p>
<p>To summarize, yes XDM 3.0 does support JSON but to do pretty much anything interesting with JSON objects, you&#8217;d better transform them into XML nodes first! XSLT 3.0 does give you the tools to do this transformation quite easily but the message to JSON users is that we don&#8217;t treat their data model as a first class citizen.</p>
<p>To make it worse, XPath is used by many other specifications, within and outside the W3C and the level of support for JSON provided by XDM and XPath will determine how these specifications will be able to support for JSON. Specifications that are impacted by this issue include XForms, XProc and Schematron. Supporting JSON would be really useful for these three specifications if and only if map items could have the same features than nodes.</p>
<p>Furthermore, the same asymmetry exists when you went to create these two structures from other sources: to create the XML structure you can use sequence constructors but to create the map structure, you have to use the <code class="code">map:new()</code> and <code class="code">map:item()</code> functions.</p>
<p>My proposal to solve this issue is:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">To acknowledge the fact that any type of information item can be either &#8220;context independent&#8221; or include context information and explore the consequences of thisstatement.</li>
<li class="listitem">To generalize XPath axis so that they can be used with map items.</li>
<li class="listitem">To create sequence constructors for maps and map entries.</li>
</ul>
</div>
<p>You are welcome to discuss this further:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">W3C XSLT 3.0 <a class="link" href="http://eric.van-der-vlist.com/blog/owark/1025" target="_blank">Bug 16118</a>, &#8220;Maps should be first class citizens&#8221;</li>
<li class="listitem">Blog entry: <a class="link" href="http://eric.van-der-vlist.com/blog/2012/02/25/xdm-maps-should-be-first-class-citizens/" target="_blank">XDM Maps should be first class citizens</a>.</li>
<li class="listitem">Blog entry: <a class="link" href="http://eric.van-der-vlist.com/blog/2012/02/28/more-musings-on-xdm-3-0/" target="_blank">More musings on XDM 3.0</a></li>
</ul>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e221"></a>Introducing χίμαιραλ (chimeral), the Chimera Language</h2>
</div>
</div>
</div>
<p>When I started to work on <a class="link" href="http://%CF%87%CE%AF%CE%BC%CE%B1%CE%B9%CF%81%CE%B1%CE%BB.com" target="_blank">χίμαιραλ</a> a few months ago, my first motivation was to propose an XDM serialization for maps which would turn the rather abstract prose from the specification into concrete angle brackets that you could see and read.</p>
<p>The exercise has been very instructive and helped me a lot to understand the spec, however a more ambitious use pattern has emerged while I was making progress. The XSLT 3.0 Working Draft is part of a batch of Working Drafts which are far more advanced. My proposals to solve the &#8220;map identity crisis&#8221; are probably too intrusive and too late to be taken into account and the batch of specifications will most probably carry on with the current proposal.</p>
<p>If that&#8217;s the case, we&#8217;ve seen that it makes a lot of sense to convert maps into nodes to enable to use XPath axis and χίμαιραλ provides a generic target format for these conversions.</p>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e227"></a>Example</h3>
</div>
</div>
</div>
<p>Let&#8217;s take again the JSON object borrowed from the XSLT 3.0 Working Draft:</p>
<pre class="programlisting brush: js">{ "accounting" : [ 
      { "firstName" : "John", 
        "lastName"  : "Doe",
        "age"       : 23 },

      { "firstName" : "Mary", 
        "lastName"  : "Smith",
        "age"       : 32 }
                 ],                                 
  "sales"     : [ 
      { "firstName" : "Sally", 
        "lastName"  : "Green",
        "age"       : 27 },

      { "firstName" : "Jim",  
        "lastName"  : "Galley",
        "age"       : 41 }
                  ]
}</pre>
<p>Its χίμαιραλ representation is:</p>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;χ:data-model xmlns:χ="http://χίμαιραλ.com#"&gt;
    &lt;χ:map&gt;
        &lt;χ:entry key="sales" keyType="string"&gt;
            &lt;χ:map&gt;
                &lt;χ:entry key="1" keyType="number"&gt;
                    &lt;χ:map&gt;
                        &lt;χ:entry key="lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Green&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;27&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Sally&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                    &lt;/χ:map&gt;
                &lt;/χ:entry&gt;
                &lt;χ:entry key="2" keyType="number"&gt;
                    &lt;χ:map&gt;
                        &lt;χ:entry key="lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Galley&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;41&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Jim&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                    &lt;/χ:map&gt;
                &lt;/χ:entry&gt;
            &lt;/χ:map&gt;
        &lt;/χ:entry&gt;
        &lt;χ:entry key="accounting" keyType="string"&gt;
            &lt;χ:map&gt;
                &lt;χ:entry key="1" keyType="number"&gt;
                    &lt;χ:map&gt;
                        &lt;χ:entry key="lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Doe&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;23&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;John&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                    &lt;/χ:map&gt;
                &lt;/χ:entry&gt;
                &lt;χ:entry key="2" keyType="number"&gt;
                    &lt;χ:map&gt;
                        &lt;χ:entry key="lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Smith&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;32&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Mary&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                    &lt;/χ:map&gt;
                &lt;/χ:entry&gt;
            &lt;/χ:map&gt;
        &lt;/χ:entry&gt;
    &lt;/χ:map&gt;
&lt;/χ:data-model&gt;</pre>
<p>Granted, it&#8217;s much more verbose than the JSON version, but it&#8217;s the exact translation of the XDM corresponding to the JSON object in XML.</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e234"></a>χίμαιραλ In a Nutshell</h3>
</div>
</div>
</div>
<p>The design goals are:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">Be as close as possible to the XDM and its terminology</li>
<li class="listitem">Represent XML nodes as&#8230; XML nodes</li>
<li class="listitem">Allow round-trips (an XDM model serialized as χίμαιραλ should give a XDM model identical to the original one when de-serialized)</li>
<li class="listitem">Be easy to process using XPath/XQuery/XSLT</li>
<li class="listitem">Support of the PSVI is not a goal</li>
</ul>
</div>
<p>χίμαιραλ is not the only proposal to serialize XDM as XML. Two other notable ones are:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">Zorba&#8217;s <a class="link" href="http://bazaar.launchpad.net/~zorba-coders/zorba/pul-and-xdm-schemas/view/head:/schemas/xdm.xsd" target="_blank">XDM serialization</a>is a straight andaccurate XDM serialization which does support PSVI annotations. As a consequence, nodes are serialized as <code class="code">xdm:*</code>elements (an element is an<code class="code">xdm:element</code>, an attribute an <code class="code">xdm:attribute</code> element, &#8230;). This does&#8217;n meet by second requirement to represent nodes as themselves.</li>
<li class="listitem"><a class="link" href="http://balisage.net/Proceedings/vol7/html/Rennau01/BalisageVol7-Rennau01.html" target="_blank">XDML</a>, presented by Rennau, Hans-Jürgen, and David A. Lee atBalisage 2011 is more than just an XDM serialization and also includes manipulation and processing definitions. It introduces its own terminology and concepts and is toofar away from XDM for my design goals.</li>
</ul>
</div>
<p>A lot of attention has been given to the first design goal: the structure of a χίμαιραλ model and the name of its elements and attributes are directly derived from the specifications.</p>
<p>In XDM, map entries&#8217; values can be arrays (an array beeing nothing else than a map with integer keys) but also sequences (which is not possible in JSON). χίμαιραλ respects the fact that in XDM there is no difference between a sequence composed of a single element and represents sequences by a repetition of values.</p>
<p>The map <code class="code">map{1:= 'foo'}</code> is serialized as:</p>
<pre class="programlisting brush: xml">&lt;χ:data-model xmlns:χ="http://χίμαιραλ.com#"&gt;
   &lt;χ:map&gt;
      &lt;χ:entry key="1" keyType="number"&gt;
         &lt;χ:atomic-value type="string"&gt;foo&lt;/χ:atomic-value&gt;
      &lt;/χ:entry&gt;
   &lt;/χ:map&gt;
&lt;/χ:data-model&gt;</pre>
<p>And the map <code class="code">map{1:= ('foo', 'bar')}</code> is serialized as:</p>
<pre class="programlisting brush: xml">&lt;χ:data-model xmlns:χ="http://χίμαιραλ.com#"&gt;
   &lt;χ:map&gt;
      &lt;χ:entry key="1" keyType="number"&gt;
         &lt;χ:atomic-value type="string"&gt;foo&lt;/χ:atomic-value&gt;
         &lt;χ:atomic-value type="string"&gt;bar&lt;/χ:atomic-value&gt;
      &lt;/χ:entry&gt;
   &lt;/χ:map&gt;
&lt;/χ:data-model&gt;</pre>
<p>We&#8217;ve seen that XDM makes a clear distinction between nodes which have identities and other item types (atomic values, functions and maps) which haven&#8217;t. XDM allows to use nodes as map entry values. χίμαιραλ allows this feature too, but copying the nodes would create new nodes with different identities.</p>
<p>To avoid that, documents to which these nodes belong are copied into χ:instance elements and references between map entries values and instances are made using XPath expressions.</p>
<p>The following <code class="code">$map</code> variable:</p>
<pre class="programlisting brush: xml">&lt;xsl:variable name="a-node"&gt;
    &lt;foo/&gt;
&lt;/xsl:variable&gt;
&lt;xsl:variable name="map" select="map{'a-node':= $a-node}"/&gt;</pre>
<p>Is serialized as:</p>
<pre class="programlisting brush: xml">&lt;χ:data-model xmlns:χ="http://χίμαιραλ.com#"&gt;
   &lt;χ:instance id="d4" kind="document"&gt;
      &lt;foo/&gt;
   &lt;/χ:instance&gt;
   &lt;χ:map&gt;
      &lt;χ:entry key="a-node" keyType="string"&gt;
         &lt;χ:node kind="document" instance="d4" path="/"/&gt;
      &lt;/χ:entry&gt;
   &lt;/χ:map&gt;
&lt;/χ:data-model&gt;</pre>
<p>Like XSLT variable, instances do not always contain document nodes and the following <code class="code">$map</code> variable:</p>
<pre class="programlisting brush: xml">&lt;xsl:variable name="a-node" as="node()"&gt;
    &lt;foo/&gt;
&lt;/xsl:variable&gt;
&lt;xsl:variable name="map" select="map{'a-node':= $a-node}"/&gt;</pre>
<p>Is serialized as:</p>
<pre class="programlisting brush: xml">&lt;χ:data-model xmlns:χ="http://χίμαιραλ.com#"&gt;
   &lt;χ:instance id="d4e0" kind="fragment"&gt;
      &lt;foo/&gt;
   &lt;/χ:instance&gt;
   &lt;χ:map&gt;
      &lt;χ:entry key="a-node" keyType="string"&gt;
         &lt;χ:node kind="element" instance="d4e0" path="root()" name="foo"/&gt;
      &lt;/χ:entry&gt;
   &lt;/χ:map&gt;
&lt;/χ:data-model&gt;</pre>
<p>Nodes can belong to more than one instances, and this $map variable:</p>
<pre class="programlisting brush: xml">&lt;xsl:variable name="a-node" as="node()*"&gt;
    &lt;foo/&gt;
    &lt;bar/&gt;
&lt;/xsl:variable&gt;
&lt;xsl:variable name="map" select="map{'a-node':= $a-node}"/&gt;</pre>
<p>Is serialized as:</p>
<pre class="programlisting brush: xml">&lt;χ:data-model xmlns:χ="http://χίμαιραλ.com#"&gt;
   &lt;χ:instance id="d4e0" kind="fragment"&gt;
      &lt;foo/&gt;
   &lt;/χ:instance&gt;
   &lt;χ:instance id="d4e3" kind="fragment"&gt;
      &lt;bar/&gt;
   &lt;/χ:instance&gt;
   &lt;χ:map&gt;
      &lt;χ:entry key="a-node" keyType="string"&gt;
         &lt;χ:node kind="element" instance="d4e0" path="root()" name="foo"/&gt;
         &lt;χ:node kind="element" instance="d4e3" path="root()" name="bar"/&gt;
      &lt;/χ:entry&gt;
   &lt;/χ:map&gt;
&lt;/χ:data-model&gt;</pre>
<p>Nodes can be &#8220;deep linked&#8221;, a same node can be linked several times and nodes can be mixed with atomic values at wish. The following $map variable:</p>
<pre class="programlisting brush: xml">&lt;xsl:variable name="doc"&gt;
    &lt;department name="sales"&gt;
        &lt;employee&gt;
            &lt;firstName&gt;Sally&lt;/firstName&gt;
            &lt;lastName&gt;Green&lt;/lastName&gt;
            &lt;age&gt;27&lt;/age&gt;
        &lt;/employee&gt;
        &lt;employee&gt;
            &lt;firstName&gt;Jim&lt;/firstName&gt;
            &lt;lastName&gt;Galley&lt;/lastName&gt;
            &lt;age&gt;41&lt;/age&gt;
        &lt;/employee&gt;
    &lt;/department&gt;
    &lt;department name="accounting"&gt;
        &lt;employee&gt;
            &lt;firstName&gt;John&lt;/firstName&gt;
            &lt;lastName&gt;Doe&lt;/lastName&gt;
            &lt;age&gt;23&lt;/age&gt;
        &lt;/employee&gt;
        &lt;employee&gt;
            &lt;firstName&gt;Mary&lt;/firstName&gt;
            &lt;lastName&gt;Smith&lt;/lastName&gt;
            &lt;age&gt;32&lt;/age&gt;
        &lt;/employee&gt;
    &lt;/department&gt;
&lt;/xsl:variable&gt;
&lt;xsl:variable name="map"
    select="map{
            'sales' := $doc/department[@name='sales'],
            'Sally' := $doc//employee[firstName = 'Sally'],
            'kids'  := $doc//employee[age &amp;lt; 30],
            'dep-names-attributes' := $doc/department/@name,
            'dep-names' := for $name in $doc/department/@name return string($name)
            }"/&gt;</pre>
<p>Is serialized as:</p>
<pre class="programlisting brush: xml">&lt;χ:data-model xmlns:χ="http://χίμαιραλ.com#"&gt;
   &lt;χ:instance id="d4" kind="document"&gt;
      &lt;department name="sales"&gt;
         &lt;employee&gt;
            &lt;firstName&gt;Sally&lt;/firstName&gt;
            &lt;lastName&gt;Green&lt;/lastName&gt;
            &lt;age&gt;27&lt;/age&gt;
         &lt;/employee&gt;
         &lt;employee&gt;
            &lt;firstName&gt;Jim&lt;/firstName&gt;
            &lt;lastName&gt;Galley&lt;/lastName&gt;
            &lt;age&gt;41&lt;/age&gt;
         &lt;/employee&gt;
      &lt;/department&gt;
      &lt;department name="accounting"&gt;
         &lt;employee&gt;
            &lt;firstName&gt;John&lt;/firstName&gt;
            &lt;lastName&gt;Doe&lt;/lastName&gt;
            &lt;age&gt;23&lt;/age&gt;
         &lt;/employee&gt;
         &lt;employee&gt;
            &lt;firstName&gt;Mary&lt;/firstName&gt;
            &lt;lastName&gt;Smith&lt;/lastName&gt;
            &lt;age&gt;32&lt;/age&gt;
         &lt;/employee&gt;
      &lt;/department&gt;
   &lt;/χ:instance&gt;
   &lt;χ:map&gt;
      &lt;χ:entry key="sales" keyType="string"&gt;
         &lt;χ:node kind="element"
                 instance="d4"
                 path="/&amp;#34;&amp;#34;:department[1]"
                 name="department"/&gt;
      &lt;/χ:entry&gt;
      &lt;χ:entry key="Sally" keyType="string"&gt;
         &lt;χ:node kind="element"
                 instance="d4"
                 path="/&amp;#34;&amp;#34;:department[1]/&amp;#34;&amp;#34;:employee[1]"
                 name="employee"/&gt;
      &lt;/χ:entry&gt;
      &lt;χ:entry key="kids" keyType="string"&gt;
         &lt;χ:node kind="element"
                 instance="d4"
                 path="/&amp;#34;&amp;#34;:department[1]/&amp;#34;&amp;#34;:employee[1]"
                 name="employee"/&gt;
         &lt;χ:node kind="element"
                 instance="d4"
                 path="/&amp;#34;&amp;#34;:department[2]/&amp;#34;&amp;#34;:employee[1]"
                 name="employee"/&gt;
      &lt;/χ:entry&gt;
      &lt;χ:entry key="dep-names-attributes" keyType="string"&gt;
         &lt;χ:node kind="attribute"
                 instance="d4"
                 path="/&amp;#34;&amp;#34;:department[1]/@name"
                 name="name"&gt;sales&lt;/χ:node&gt;
         &lt;χ:node kind="attribute"
                 instance="d4"
                 path="/&amp;#34;&amp;#34;:department[2]/@name"
                 name="name"&gt;accounting&lt;/χ:node&gt;
      &lt;/χ:entry&gt;
      &lt;χ:entry key="dep-names" keyType="string"&gt;
         &lt;χ:atomic-value type="string"&gt;sales&lt;/χ:atomic-value&gt;
         &lt;χ:atomic-value type="string"&gt;accounting&lt;/χ:atomic-value&gt;
      &lt;/χ:entry&gt;
   &lt;/χ:map&gt;
&lt;/χ:data-model&gt;</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e287"></a>Remaining Issues</h3>
</div>
</div>
</div>
<p>A collation property should be added to <code class="code">&lt;χ:map/&gt;</code>, probably as an attribute, the transformation to serialize to χίμαιραλ should be cleaned up and the reverse transformation should be implemented.</p>
<p>These are pretty trivial issues and the biggest one is probably to find a way to cleanly serialize references to nodes that are not contained within an element, such as the following $map variable:</p>
<pre class="programlisting brush: xml">&lt;xsl:variable name="attribute" as="node()"&gt;
    &lt;xsl:attribute name="foo"&gt;bar&lt;/xsl:attribute&gt;
&lt;/xsl:variable&gt;
&lt;xsl:variable name="map"
    select="map{
            'attribute' := $attribute
            }"/&gt;</pre>
<p>Support of functions should also be considered.</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e294"></a>χίμαιραλ and the identity crisis</h3>
</div>
</div>
</div>
<p>To some extend, χίμαιραλ can be considered as a solution to the XDM identity crisis:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">Serializing an XDM model as χίμαιραλ creates elements for maps, map entries and atomic values and these elements, being nodes, have identities. The serialization istherefore also an instantiation of XDM information items as defined above.</li>
<li class="listitem">De-serializing a χίμαιραλ to create an XDM data model is also a de-instantiation&#8211; except of course that the identity of XML nodes is not &#8220;removed&#8221;.</li>
</ul>
</div>
<p>However, χίμαιραλ does keep a strong difference between nodes which are kept in <code class="code">&lt;χ:instance&gt;</code> elements and maps and atomic values.</p>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e304"></a>Moving the chimera forward</h2>
</div>
</div>
</div>
<p>χίμαιραλ is a good playground to explore the new possibilities offered by XDM 3.0. Here is a (non exhaustive) list of a few directions that seem interesting&#8230;</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<table summary="Note" border="0">
<tbody>
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/note.png" alt="A note" /></td>
<th align="left">Note</th>
</tr>
<tr>
<td align="left" valign="top">Don&#8217;t expect to find fully baked proposals in this section which contains, on the contrary very early drafts of ideas to follow to support XDM maps as &#8220;first class citizens&#8221;!</td>
</tr>
</tbody>
</table>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e309"></a>Embracing RDF</h3>
</div>
</div>
</div>
<p>If you had the opportunity to enjoy the sunny weather of Orlando in December 2001, you may remember &#8220;<a class="link" href="http://web.archive.org/web/20020115041927/http://www.idealliance.org/papers/xml2001/papers/html/03-01-04.html" target="_blank">The Syntactic Web</a>&#8221; a provocative talk where Jonathan Robie has shown how XQuery 1.0 could be used to query normalized XML/RDF documents.</p>
<p>The gap between RDF triples and the versatility of its XML representation was a big issue, but the new features brought by this new version of the XPath/XQuery/XSLT package should help us.</p>
<p>The basic data model of RDF is based on triples, a triple being a composed of a subject, a predicate and an object. In XDM, a triple can now be represented by either a sequence, an array or a map of three items.</p>
<p>XDM sequences have the property that they cannot include other sequences and representing triples as sequences would mean that you couldn&#8217;t define sequences of triples. For that reason it is probably better to define triples as maps or arrays. An array being a map indexed by integers, that doesn&#8217;t make a huge difference at a conceptual level, but I find it cleaner to access to the subject of a triple using a QName (such as rdf:subject) rather than an index. Following this principle, we could define a triple as:</p>
<pre class="programlisting brush: xml">map {
    xs:QName('rdf:subject')   := xs:anyURI('http://www.example.org/index.html'),
    xs:QName('rdf:predicate') := xs:anyURI('http://purl.org/dc/elements/1.1/creator'),
    xs:QName('rdf:object')    := xs:anyURI('http://www.example.org/staffid/85740')
}</pre>
<p>The χίμαιραλ serialization of this map is:</p>
<pre class="programlisting brush: xml">&lt;χ:data-model xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:χ="http://χίμαιραλ.com#"
              xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"&gt;
   &lt;χ:map&gt;
      &lt;χ:entry key="rdf:object"
               keyType="xs:QName"&gt;
         &lt;χ:atomic-value type="xs:anyURI"&gt;http://www.example.org/staffid/85740&lt;/χ:atomic-value&gt;
      &lt;/χ:entry&gt;
      &lt;χ:entry key="rdf:predicate"
               keyType="xs:QName"&gt;
         &lt;χ:atomic-value type="xs:anyURI"&gt;http://purl.org/dc/elements/1.1/creator&lt;/χ:atomic-value&gt;
      &lt;/χ:entry&gt;
      &lt;χ:entry key="rdf:subject"
               keyType="xs:QName"&gt;
         &lt;χ:atomic-value type="xs:anyURI"&gt;http://www.example.org/index.html&lt;/χ:atomic-value&gt;
      &lt;/χ:entry&gt;
   &lt;/χ:map&gt;
&lt;/χ:data-model&gt;</pre>
<p>What can we do with such triples? Using higher order functions, it should not be too difficult to define triple stores with basic query features!</p>
<p>Is this lightweight enough? Or does RDF support deserve new information item types to be supported by XDM?</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e321"></a>Syntactical sugar</h3>
</div>
</div>
</div>
<p>We&#8217;ve seen that this JSON object</p>
<pre class="programlisting brush: js">{ "accounting" : [ 
      { "firstName" : "John", 
        "lastName"  : "Doe",
        "age"       : 23 },

      { "firstName" : "Mary", 
        "lastName"  : "Smith",
        "age"       : 32 }
                 ],                                 
  "sales"     : [ 
      { "firstName" : "Sally", 
        "lastName"  : "Green",
        "age"       : 27 },

      { "firstName" : "Jim",  
        "lastName"  : "Galley",
        "age"       : 41 }
                  ]
}</pre>
<p>Is serialized in χίμαιραλ as:</p>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;χ:data-model xmlns:χ="http://χίμαιραλ.com#"&gt;
    &lt;χ:map&gt;
        &lt;χ:entry key="sales" keyType="string"&gt;
            &lt;χ:map&gt;
                &lt;χ:entry key="1" keyType="number"&gt;
                    &lt;χ:map&gt;
                        &lt;χ:entry key="lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Green&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;27&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Sally&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                    &lt;/χ:map&gt;
                &lt;/χ:entry&gt;
                &lt;χ:entry key="2" keyType="number"&gt;
                    &lt;χ:map&gt;
                        &lt;χ:entry key="lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Galley&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;41&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Jim&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                    &lt;/χ:map&gt;
                &lt;/χ:entry&gt;
            &lt;/χ:map&gt;
        &lt;/χ:entry&gt;
        &lt;χ:entry key="accounting" keyType="string"&gt;
            &lt;χ:map&gt;
                &lt;χ:entry key="1" keyType="number"&gt;
                    &lt;χ:map&gt;
                        &lt;χ:entry key="lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Doe&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;23&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;John&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                    &lt;/χ:map&gt;
                &lt;/χ:entry&gt;
                &lt;χ:entry key="2" keyType="number"&gt;
                    &lt;χ:map&gt;
                        &lt;χ:entry key="lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Smith&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;32&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Mary&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                    &lt;/χ:map&gt;
                &lt;/χ:entry&gt;
            &lt;/χ:map&gt;
        &lt;/χ:entry&gt;
    &lt;/χ:map&gt;
&lt;/χ:data-model&gt;</pre>
<p>We can work with that, but wouldn&#8217;t it be nice if we had a native syntax that does not use XML elements and attributes to represent maps?</p>
<p>Depending on the requirements, many approaches are possible.</p>
<p>A first option would be to define pluggable notation parsers within XML and write:</p>
<pre class="programlisting brush: xml">&lt;χ:notation mediatype="application/json"&gt;&lt;![CDATA[
{ "accounting" : [ 
      { "firstName" : "John", 
        "lastName"  : "Doe",
        "age"       : 23 },

      { "firstName" : "Mary", 
        "lastName"  : "Smith",
        "age"       : 32 }
                 ],                                 
  "sales"     : [ 
      { "firstName" : "Sally", 
        "lastName"  : "Green",
        "age"       : 27 },

      { "firstName" : "Jim",  
        "lastName"  : "Galley",
        "age"       : 41 }
                  ]
}                  
]]&gt;&lt;/χ:notation&gt;</pre>
<p>The meaning of the <code class="code">&lt;χ:notation/&gt;</code> element would be to trigger a parser supporting the application/json datatype. This is less verbose, more natural to JSON users, but doesn&#8217;t allow to add XML nodes in maps or sequences.</p>
<p>Another direction would be to extend the syntax of XML itself. To do so, again, there are many possibilities. The markup in XML is based on angle brackets and the distinction between the different XML productions is usually done through the character following the bracket in the opening tags.</p>
<p>This principle leaves a lot of possibilities. For instance, maps could be identified by the tags <code class="code">&lt;{&gt;</code> and <code class="code">&lt;/}&gt;</code> to follow the characters used by XDM map literals and JSON objects:</p>
<pre class="programlisting brush: xml">&lt;χ:data-model&gt;
    &lt;{&gt;
        &lt;χ:entry key="sales" keyType="string"&gt;
            &lt;{&gt;
                &lt;χ:entry key="1" keyType="number"&gt;
                    &lt;{&gt;
                        &lt;χ:entry key="lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Green&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;27&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Sally&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                    &lt;/}&gt;
                &lt;/χ:entry&gt;
                &lt;χ:entry key="2" keyType="number"&gt;
                    &lt;{&gt;
                        &lt;χ:entry key="lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Galley&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;41&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Jim&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                    &lt;/}&gt;
                &lt;/χ:entry&gt;
            &lt;/}&gt;
        &lt;/χ:entry&gt;
        &lt;χ:entry key="accounting" keyType="string"&gt;
            &lt;{&gt;
                &lt;χ:entry key="1" keyType="number"&gt;
                    &lt;{&gt;
                        &lt;χ:entry key="lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Doe&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;23&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;John&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                    &lt;/}&gt;
                &lt;/χ:entry&gt;
                &lt;χ:entry key="2" keyType="number"&gt;
                    &lt;{&gt;
                        &lt;χ:entry key="lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Smith&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;32&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                        &lt;χ:entry key="firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Mary&lt;/χ:atomic-value&gt;
                        &lt;/χ:entry&gt;
                    &lt;/}&gt;
                &lt;/χ:entry&gt;
            &lt;/}&gt;
        &lt;/χ:entry&gt;
    &lt;/}&gt;
&lt;/χ:data-model&gt;</pre>
<p>Map entries are not ordered and in that respect they are similar to XML attributes. We could use this similarity and use the character <code class="code">@</code> to identify map entries:</p>
<pre class="programlisting brush: xml">&lt;χ:data-model&gt;
    &lt;{&gt;
        &lt;@"sales" keyType="string"&gt;
            &lt;{&gt;
                &lt;@"1" keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@"lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Green&lt;/χ:atomic-value&gt;
                        &lt;/@"lastName"&gt;
                        &lt;@"age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;27&lt;/χ:atomic-value&gt;
                        &lt;/@"age"&gt;
                        &lt;@"firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Sally&lt;/χ:atomic-value&gt;
                        &lt;/@"firstName"&gt;
                    &lt;/}&gt;
                &lt;/@"1"&gt;
                &lt;@"2" keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@"lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Galley&lt;/χ:atomic-value&gt;
                        &lt;/@"lastName"&gt;
                        &lt;@"age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;41&lt;/χ:atomic-value&gt;
                        &lt;/@"age"&gt;
                        &lt;@"firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Jim&lt;/χ:atomic-value&gt;
                        &lt;/@"firstName"&gt;
                    &lt;/}&gt;
                &lt;/@"2"&gt;
            &lt;/}&gt;
        &lt;/@"sales"&gt;
        &lt;@"accounting" keyType="string"&gt;
            &lt;{&gt;
                &lt;@"1" keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@"lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Doe&lt;/χ:atomic-value&gt;
                        &lt;/@"lastName"&gt;
                        &lt;@"age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;23&lt;/χ:atomic-value&gt;
                        &lt;/@"age"&gt;
                        &lt;@"firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;John&lt;/χ:atomic-value&gt;
                        &lt;/@"firstName"&gt;
                    &lt;/}&gt;
                &lt;/@"1"&gt;
                &lt;@"2" keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@"lastName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Smith&lt;/χ:atomic-value&gt;
                        &lt;/@"lastName"&gt;
                        &lt;@"age" keyType="string"&gt;
                            &lt;χ:atomic-value type="number"&gt;32&lt;/χ:atomic-value&gt;
                        &lt;/@"age"&gt;
                        &lt;@"firstName" keyType="string"&gt;
                            &lt;χ:atomic-value type="string"&gt;Mary&lt;/χ:atomic-value&gt;
                        &lt;/@"firstName"&gt;
                    &lt;/}&gt;
                &lt;/@"2"&gt;
            &lt;/}&gt;
        &lt;/@"accounting"&gt;
    &lt;/}&gt;
&lt;/χ:data-model&gt;</pre>
<p>The key names have been enclosed between quotes because map keys can include any character including whitespaces, but they can be made optional when they are not needed. We could also give to the keyType a default value of &#8220;string&#8221;:</p>
<pre class="programlisting brush: xml">&lt;χ:data-model&gt;
    &lt;{&gt;
        &lt;@sales&gt;
            &lt;{&gt;
                &lt;@1 keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@lastName&gt;
                            &lt;χ:atomic-value type="string"&gt;Green&lt;/χ:atomic-value&gt;
                        &lt;/@lastName
                        &lt;@age&gt;
                            &lt;χ:atomic-value type="number"&gt;27&lt;/χ:atomic-value&gt;
                        &lt;/@age
                        &lt;@firstName&gt;
                            &lt;χ:atomic-value type="string"&gt;Sally&lt;/χ:atomic-value&gt;
                        &lt;/@firstName
                    &lt;/}&gt;
                &lt;/@1
                &lt;@2 keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@lastName&gt;
                            &lt;χ:atomic-value type="string"&gt;Galley&lt;/χ:atomic-value&gt;
                        &lt;/@lastName
                        &lt;@age&gt;
                            &lt;χ:atomic-value type="number"&gt;41&lt;/χ:atomic-value&gt;
                        &lt;/@age
                        &lt;@firstName&gt;
                            &lt;χ:atomic-value type="string"&gt;Jim&lt;/χ:atomic-value&gt;
                        &lt;/@firstName
                    &lt;/}&gt;
                &lt;/@2
            &lt;/}&gt;
        &lt;/@sales
        &lt;@accounting&gt;
            &lt;{&gt;
                &lt;@1 keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@lastName&gt;
                            &lt;χ:atomic-value type="string"&gt;Doe&lt;/χ:atomic-value&gt;
                        &lt;/@lastName
                        &lt;@age&gt;
                            &lt;χ:atomic-value type="number"&gt;23&lt;/χ:atomic-value&gt;
                        &lt;/@age
                        &lt;@firstName&gt;
                            &lt;χ:atomic-value type="string"&gt;John&lt;/χ:atomic-value&gt;
                        &lt;/@firstName
                    &lt;/}&gt;
                &lt;/@1
                &lt;@2 keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@lastName&gt;
                            &lt;χ:atomic-value type="string"&gt;Smith&lt;/χ:atomic-value&gt;
                        &lt;/@lastName
                        &lt;@age&gt;
                            &lt;χ:atomic-value type="number"&gt;32&lt;/χ:atomic-value&gt;
                        &lt;/@age
                        &lt;@firstName&gt;
                            &lt;χ:atomic-value type="string"&gt;Mary&lt;/χ:atomic-value&gt;
                        &lt;/@firstName
                    &lt;/}&gt;
                &lt;/@2
            &lt;/}&gt;
        &lt;/@accounting
    &lt;/}&gt;
&lt;/χ:data-model&gt;</pre>
<p>Atomic values could be identified by <code class="code">&lt;=&gt;</code> and <code class="code">&lt;/=&gt;</code> and the same default value applied to its type attribute:</p>
<pre class="programlisting brush: xml">&lt;χ:data-model&gt;
    &lt;{&gt;
        &lt;@sales&gt;
            &lt;{&gt;
                &lt;@1 keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@lastName&gt;
                            &lt;=&gt;Green&lt;/=&gt;
                        &lt;/@lastName&gt;
                        &lt;@age&gt;
                            &lt;= type="number"&gt;27&lt;/=&gt;
                        &lt;/@age&gt;
                        &lt;@firstName&gt;
                            &lt;=&gt;Sally&lt;/=&gt;
                        &lt;/@firstName&gt;
                    &lt;/}&gt;
                &lt;/@1&gt;
                &lt;@2 keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@lastName&gt;
                            &lt;=&gt;Galley&lt;/=&gt;
                        &lt;/@lastName&gt;
                        &lt;@age&gt;
                            &lt;= type="number"&gt;41&lt;/=&gt;
                        &lt;/@age&gt;
                        &lt;@firstName&gt;
                            &lt;=&gt;Jim&lt;/=&gt;
                        &lt;/@firstName&gt;
                    &lt;/}&gt;
                &lt;/@2&gt;
            &lt;/}&gt;
        &lt;/@sales&gt;
        &lt;@accounting&gt;
            &lt;{&gt;
                &lt;@1 keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@lastName&gt;
                            &lt;=&gt;Doe&lt;/=&gt;
                        &lt;/@lastName&gt;
                        &lt;@age&gt;
                            &lt;= type="number"&gt;23&lt;/=&gt;
                        &lt;/@age&gt;
                        &lt;@firstName&gt;
                            &lt;=&gt;John&lt;/=&gt;
                        &lt;/@firstName&gt;
                    &lt;/}&gt;
                &lt;/@1&gt;
                &lt;@2 keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@lastName&gt;
                            &lt;=&gt;Smith&lt;/=&gt;
                        &lt;/@lastName&gt;
                        &lt;@age&gt;
                            &lt;= type="number"&gt;32&lt;/=&gt;
                        &lt;/@age&gt;
                        &lt;@firstName&gt;
                            &lt;=&gt;Mary&lt;/=&gt;
                        &lt;/@firstName&gt;
                    &lt;/}&gt;
                &lt;/@2&gt;
            &lt;/}&gt;
        &lt;/@accounting&gt;
    &lt;/}&gt;
&lt;/χ:data-model&gt;</pre>
<p>The tags that surround atomic values are useful when these values are within a sequence but look superfluous when the item has a single value. The next step could be to define that in that case as a shortcut the value and its type attribute could be directly included in the item:</p>
<pre class="programlisting brush: xml">&lt;χ:data-model&gt;
    &lt;{&gt;
        &lt;@sales&gt;
            &lt;{&gt;
                &lt;@1 keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@lastName&gt;Green&lt;/@lastName&gt;
                        &lt;@age type="number"&gt;27&lt;/@age&gt;
                        &lt;@firstName&gt;Sally&lt;/@firstName&gt;
                    &lt;/}&gt;
                &lt;/@1&gt;
                &lt;@2 keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@lastName&gt;Galley&lt;/@lastName&gt;
                        &lt;@age type="number"&gt;41&lt;/@age&gt;
                        &lt;@firstName&gt;Jim&lt;/@firstName&gt;
                    &lt;/}&gt;
                &lt;/@2&gt;
            &lt;/}&gt;
        &lt;/@sales&gt;
        &lt;@accounting&gt;
            &lt;{&gt;
                &lt;@1 keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@lastName&gt;Doe&lt;/@lastName&gt;
                        &lt;@age type="number"&gt;23&lt;/@age&gt;
                        &lt;@firstName&gt;John&lt;/@firstName&gt;
                    &lt;/}&gt;
                &lt;/@1&gt;
                &lt;@2 keyType="number"&gt;
                    &lt;{&gt;
                        &lt;@lastName&gt;Smith&lt;/@lastName&gt;
                        &lt;@age type="number"&gt;32&lt;/@age&gt;
                        &lt;@firstName&gt;Mary&lt;/@firstName&gt;
                    &lt;/}&gt;
                &lt;/@2&gt;
            &lt;/}&gt;
        &lt;/@accounting&gt;
    &lt;/}&gt;
&lt;/χ:data-model&gt;</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e348"></a>XPath</h3>
</div>
</div>
</div>
<p>The χίμαιραλ serialization being XML, it is possible to use XPath path expressions to query its structure. For instance, to get a list of employees which are less than 30, we can</p>
<p>write:</p>
<pre class="programlisting brush: xml">χ:map/χ:entry/χ:map/χ:entry/χ:map[χ:entry[@key='age'][χ:atomic-value &lt; 30]]</pre>
<p>Or, if we&#8217;re feeling lucky:</p>
<pre class="programlisting brush: xml">//χ:map[χ:entry[@key='age'][χ:atomic-value &lt; 30]]</pre>
<p>Again, that&#8217;s good as long we work on a χίμαιραλ serialization but it would be good to be able to use <a class="link" href="http://www.w3.org/TR/2011/WD-xpath-30-20111213/#id-path-expressions" target="_blank">path expressions</a> directly on map data structures. To do so we would need at minima to define steps to match maps and entries.</p>
<p>XSLT 3.0 introduces a new <a class="link" href="http://www.w3.org/TR/xslt-30/#map-type" target="_blank"><code class="code">map()</code> item type</a> which could be used as a <a class="link" href="http://www.w3.org/TR/2011/WD-xpath-30-20111213/#doc-xpath30-KindTest" target="_blank">kind test</a> to identify maps.</p>
<p>If we follow the idea that map entries are similar to XML attributes, we could use the <code class="code">@</code> notation to identify them. The XPath expression would then become:</p>
<pre class="programlisting brush: xml">map()/@*/map()/@*/map()[@age &lt; 30]]</pre>
<p>Or, if we&#8217;re feeling lucky:</p>
<pre class="programlisting brush: xml">//map()[@age &lt; 30]]</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d5e365"></a>Validation</h3>
</div>
</div>
</div>
<p>These data models can be complex. Wouldn&#8217;t it be useful to be able to validate them with schema languages? This would give us a way to validate JSON maps!</p>
<p>Of course we can already serialize them in χίμαιραλ and validate the serialization using any schema language, but again it would be good to be able to validate these structures directly.</p>
<p>A RELAX NG schema to validate the χίμαιραλ serialization of our example would be:</p>
<pre class="programlisting brush: xml">namespace χ = "http://χίμαιραλ.com#"

start = element χ:data-model { top-level-map }

# Top level map: departments
top-level-map =
    element χ:map {
        element χ:entry {
            attribute key { xsd:NMTOKEN },
            attribute keyType { "string" },
            emp-array
        }*
    }

# List of employees
emp-array =
    element χ:map {
        element χ:entry {
            attribute key { xsd:positiveInteger },
            attribute keyType { "number" },
            emp-map
        }*
    }

# Description of an employee
emp-map = element χ:map { (age | firstName | lastName) + }

age =
    element χ:entry {
        attribute key { "age" },
        attribute keyType { "string" },
        element χ:atomic-value {
            attribute type { "number" },
            xsd:positiveInteger
        }
    }

firstName =
    element χ:entry {
        attribute key { "firstName" },
        attribute keyType { "string" },
        element χ:atomic-value {
            attribute type { "string" },
            xsd:token
        }
    }

lastName =
    element χ:entry {
        attribute key { "lastName" },
        attribute keyType { "string" },
        element χ:atomic-value {
            attribute type { "string" },
            xsd:token
        }
    }</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<table summary="Note" border="0">
<tbody>
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/note.png" alt="A note" /></td>
<th align="left">Note</th>
</tr>
<tr>
<td align="left" valign="top">In the description of the maps used to describe employees, we cannot use <code class="code">interleave</code> patterns because of the <a class="link" href="http://relaxng.org/spec-20011203.html#interleave-restrictions" target="_blank">restriction on interleave</a> and the schema is approximate. In this specific case, we could</p>
<p>enumerate the six possible combinations but the exercise would quickly become verbose if the number of items</p>
<p>grew:</p>
<pre class="programlisting brush: xml">emp-map = element χ:map { 
      (age, firstName, lastName)  
    | (age, lastName, firstName) 
    | (firstName, age, lastName)  
    | (firstName, lastName, age) 
    | (lastName, age, firstName)  
    | (lastName, firstName, age) 
}</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>A Schematron schema for the χίμαιραλ serialization could be developed based on XPath expressions similar to those that have been shown in the previous section.</p>
<p>Again, it would be interesting to support maps directly as first class citizens in XML schema languages.</p>
<p>The ability to use Schematron on XDM maps depends directly on the ability to browse maps using patterns and path expressions in XPath and XSLT (see above)&#8230;</p>
<p>The main impact on RELAX NG would be to add <code class="code">map</code> and <code class="code">item</code> patterns and the schema could look like:</p>
<pre class="programlisting brush: xml">namespace χ = "http://χίμαιραλ.com#"

start = element χ:data-model { top-level-map }

# Top level map: departments
top-level-map =
    map  {
        entry xsd:NMTOKEN {
            emp-array
        }*
    }

# List of employees
emp-array =
    map {
        entry xsd:positiveInteger {
            emp-map
        }*
    }

# Description of an employee
emp-map = map { age, firstName, lastName  }

age =
    entry age {
            xsd:positiveInteger
        }
    }

firstName =
    entry firstName {
             xsd:token
        }
    }

lastName =
    entry lastName {
            xsd:token
        }
    }</pre>
<p>Sequences could probably be supported without adding a new pattern but would require to relax some restrictions to allow the description of sequences mixing atomic values, maps and nodes (in Relax NG, sequences of atomic values are already possible in list datatypes, sequences of nodes are of course available to describe node contents but these two type of sequences cannot be mixed).</p>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e384"></a>Conclusion</h2>
</div>
</div>
</div>
<p>According to the definition of chimeras in genetics from Wikipedia quoted in the introduction, [<span class="citation">chimeras are formed from at least four parent cells (two fertilized eggs or early</span> embryos fused together). Each population of cells keeps its own character and the resulting organism is a mixture of tissues].</p>
<p>The current XDM proposals have added to the XML data model a foreign model to represent maps. This new model is a superset of the JSON data model. The two data models keep their own character and the resulting model is a mixture of information items.</p>
<p>It&#8217;s far to say that the current XDM proposal is a chimera, something described as [<span class="citation">usually ugly, foolish or impossible fantasies</span>] by Jeni Tennison.</p>
<p>I hope that the proposals sketched in this paper will help to address this situation and fully integrate these new information items in the XML echosystem.</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2012/08/08/fleshing-the-xdm-chimera/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Test driven XML development</title>
		<link>http://eric.van-der-vlist.com/blog/2012/08/07/test-driven-xml-development/</link>
		<comments>http://eric.van-der-vlist.com/blog/2012/08/07/test-driven-xml-development/#comments</comments>
		<pubDate>Tue, 07 Aug 2012 16:30:19 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[test driven development]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=699</guid>
		<description><![CDATA[Can test driven development be applied to XML technologies? to XSLT? to XML schema languages? XML pipelines? This is the topic of the poster I am presenting this year at the Balisage conference. For those of you who are not &#8230; <a href="http://eric.van-der-vlist.com/blog/2012/08/07/test-driven-xml-development/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Can test driven development be applied to XML technologies? to XSLT? to XML schema languages? XML pipelines?</p>
<p>This is the topic of the <a href="http://www.balisage.net/posters.html">poster</a> I am presenting this year at the <a href="http://www.balisage.net/index.html">Balisage</a> conference.</p>
<p>For those of you who are not lucky enough to attend, here is a copy of this poster: <a href="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/poster-a4.pdf">Test driven development in XML Balisage 2012 poster</a></p>
]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2012/08/07/test-driven-xml-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Schema test driven development</title>
		<link>http://eric.van-der-vlist.com/blog/2012/08/07/schema-test-driven-development/</link>
		<comments>http://eric.van-der-vlist.com/blog/2012/08/07/schema-test-driven-development/#comments</comments>
		<pubDate>Tue, 07 Aug 2012 15:33:37 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[test driven development]]></category>
		<category><![CDATA[test first programming]]></category>
		<category><![CDATA[xml schema]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=678</guid>
		<description><![CDATA[Note: this article is derived from the presentation I have given at the International Symposium on Quality Assurance and Quality Control in XML (precedings). Abstract Ever modified an XML schema? Ever broken something while fixing a bug or adding a &#8230; <a href="http://eric.van-der-vlist.com/blog/2012/08/07/schema-test-driven-development/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div class="article">
<div class="titlepage">
<div>
<div>
<div class="abstract">
<p class="title"><em>Note: this article is derived from <a href="http://www.balisage.net/QA-QC/QA-QC-Program.html#m950">the presentation</a> I have given at the <a href="http://www.balisage.net/QA-QC/index.html">International Symposium on Quality Assurance and Quality Control in XML</a> (<a href="http://www.balisage.net/Proceedings/vol9/html/Vlist02/BalisageVol9-Vlist02.html">precedings</a>).</em></p>
<p class="title"><strong>Abstract</strong></p>
<p>Ever modified an XML schema? Ever broken something while fixing a bug or adding a new feature? As withany piece of engineering, the more complex a schema is, the harder it is to maintain. In other domains, unit tests dramatically reduce the number of regressions and thus provide a kind of safety net for maintainers. Can we learn from these techniques and adapt them to XML schema languages? In this workshop session, we develop a schema using unit test techniques, to illustrate their benefits in this domain.</p>
</div>
</div>
</div>
<hr />
</div>
<div class="toc">
<p><strong>Table of Contents</strong></p>
<dl>
<dt><span class="section"><a href="#d5e22">Step 1: Getting started</a></span></dt>
<dt><span class="section"><a href="#d5e63">Step 2: Adding a schema</a></span></dt>
<dt><span class="section"><a href="#d5e113">Step 3: Adding list title elements</a></span></dt>
<dt><span class="section"><a href="#d5e184">Step 4: Adding todo item elements</a></span></dt>
<dt><span class="section"><a href="#d5e223">Step 5: Modularizing the schema</a></span></dt>
<dt><span class="section"><a href="#d5e287">Want to try it?</a></span></dt>
</dl>
</div>
<p>The workshop is run as an exchange between a customer (played by Tommie Usdin) and a schema expert (played by Eric van der Vlist).</p>
<p>The customer, needs a schema for her to list XML application, is puzzled by the &#8220;test first programming&#8221; technique imposed by the schema expert.</p>
<p>At the end of the day (or workshop), will she be converted to this well known agile or extreme programming technique adapted to the development of XML schemas?</p>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e22"></a>Step 1: Getting started</h2>
</div>
</div>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Hi Eric, can you help me to write a schema?</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Hi Tommie, yes, sure, what will the schema be about?</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">I need a vocabulary for my todo lists, with todo ite&#8230;</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">OK, you&#8217;ve told me enough, let&#8217;s get started</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert (interrupting his customer)</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Get started? but I haven&#8217;t told you anything about it!</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Right, but it&#8217;s never too soon to write tests when you do test first programming!</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="note1" style="margin-left: 0.5in; margin-right: 0.5in;">
<table summary="Note" border="0">
<tbody>
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/note.png" alt="A note" /></td>
<th align="left">Note</th>
</tr>
<tr>
<td align="left" valign="top">Test first programming (also called <a class="link" href="http://en.wikipedia.org/wiki/Test-driven_development" target="_blank">test driven development</a>) developers create test case (usually unit test cases) before implementing a function. The test suite is run, code is written based on the result of these tests and the test suite and code are updated untill all the tests pass.</td>
</tr>
</tbody>
</table>
</div>
<p>Test suite</p>
<p>(suite.xml):</p>
<pre class="programlisting brush: xml">&lt;tf:suite xmlns:tf="http://xmlschemata.org/test-first/" xmlns:todo="http://balisage.net/todo#" title="Basic tests"&gt;
    &lt;tf:case title="Root element" expected="valid" id="root"&gt;
        &lt;todo:list/&gt;
    &lt;/tf:case&gt;
&lt;/tf:suite&gt;</pre>
<div class="note1" style="margin-left: 0.5in; margin-right: 0.5in;">
<table summary="Note" border="0">
<tbody>
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/note.png" alt="A note" /></td>
<th align="left">Note</th>
</tr>
<tr>
<td align="left" valign="top">The vocabulary used to define these test cases has been inspired by the <a class="link" href="http://sut.sourceforge.net/" target="_blank">SUT</a> (XML Schema Unit Test) project. It&#8217;s a simple vocabulary (composed of only three different element) allowing to pack several XML instances together with the outcome validation result. It uses conventions that you&#8217;ll discover during the course of this workshop.</td>
</tr>
</tbody>
</table>
</div>
<div class="figure">
<p><a name="test-results"></a></p>
<p class="title"><strong>Figure 1. Test results</strong></p>
<div class="figure-contents">
<div class="mediaobject"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/Bal2012vlis1215001.png" alt="Test results" /></div>
<div class="caption">
<p>Test results</p>
</div>
</div>
</div>
<p>&nbsp;</p>
<div class="note1" style="margin-left: 0.5in; margin-right: 0.5in;">
<table summary="Note" border="0">
<tbody>
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/note.png" alt="A note" /></td>
<th align="left">Note</th>
</tr>
<tr>
<td align="left" valign="top">The test suite is run using a simple <a class="link" href="http://www.orbeon.com/" target="_blank">Orbeon Forms</a> application. The rendering relies on Orbeon Forms <a class="link" href="http://wiki.orbeon.com/forms/doc/developer-guide/orbeon-forms-xforms-compliance-matrix" target="_blank">XForms&#8217; implementation</a> while the test suite is run using an <a class="link" href="http://wiki.orbeon.com/forms/doc/developer-guide/xml-pipeline-language-xpl" target="_blank">Orbeon</a> Forms&#8217; XPLpipeline.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e63"></a>Step 2: Adding a schema</h2>
</div>
</div>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">You see, you can already write todo lists!</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Hold on, we don&#8217;t have any schema!</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">That&#8217;s true, but you don&#8217;t have to write a schema to write XML documents.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">I know, but you&#8217;re here to write a schema! Furthermore right now we accept anything. I don&#8217;t want</p>
<p>to have XML documents with anything as a root element!</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">That&#8217;s a good reason to write a schema but before that we need to add a test in our suite</p>
<p>first.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<p>Test suite</p>
<p>(suite.xml):</p>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;tf:suite xmlns:tf="http://xmlschemata.org/test-first/" xmlns:todo="http://balisage.net/todo#" title="Basic tests"&gt;
    &lt;tf:case title="TODO list toot element" expected="valid" id="root"&gt;
        &lt;todo:list/&gt;
    &lt;/tf:case&gt;
    &lt;tf:case title="Other root element" expected="error" id="other-root"&gt;
        &lt;todo:title&gt;A title&lt;/todo:title&gt;
    &lt;/tf:case&gt;
&lt;/tf:suite&gt;</pre>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Now that we&#8217;ve updated the test suite, we run it again.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="figure">
<p><a name="d5e87"></a></p>
<p class="title"><strong>Figure 2. Test results</strong></p>
<div class="figure-contents">
<div class="mediaobject"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/Bal2012vlis1215002.png" alt="Test results" /></div>
<div class="caption">
<p>Test results</p>
</div>
</div>
</div>
<p>&nbsp;</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">This result was expected and we can now proceed to create a schema and attach it to the test suite.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="http://balisage.net/todo#"
    xmlns="http://balisage.net/todo#"&gt;

    &lt;xs:element
        name="list"/&gt;
&lt;/xs:schema&gt;</pre>
<p>todo.xsd</p>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;tf:suite
    xmlns:tf="http://xmlschemata.org/test-first/"
    xmlns:todo="http://balisage.net/todo#"
    title="Basic tests"&gt;
    &lt;tf:validation
        href="todo.xsd"
        type="xsd"/&gt;
    &lt;tf:case
        title="TODO list toot element"
        expected="valid"
        id="root"&gt;
        &lt;todo:list/&gt;
    &lt;/tf:case&gt;
    &lt;tf:case
        title="Other root element"
        expected="error"
        id="other-root"&gt;
        &lt;todo:title&gt;A title&lt;/todo:title&gt;
    &lt;/tf:case&gt;
&lt;/tf:suite&gt;</pre>
<p>suite.xml</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">It&#8217;s time to test again what we&#8217;ve done.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="figure">
<p><a name="d5e106"></a></p>
<p class="title"><strong>Figure 3. Test results</strong></p>
<div class="figure-contents">
<div class="mediaobject"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/Bal2012vlis1215003.png" alt="Test results" /></div>
<div class="caption">
<p>Test results</p>
</div>
</div>
</div>
<p>&nbsp;</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e113"></a>Step 3: Adding list title elements</h2>
</div>
</div>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">I am happy to see some progress, at last, but I don&#8217;t want to accept any content in the todo list element. Can you add list title elements?</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Sure, back to the test suite&#8230;</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<p>Test suite</p>
<p>(suite.xml):</p>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;tf:suite
    xmlns:tf="http://xmlschemata.org/test-first/"
    xmlns:todo="http://balisage.net/todo#"
    title="Basic tests"&gt;
    &lt;tf:validation
        href="todo.xsd"
        type="xsd"/&gt;
    &lt;tf:case
        title="TODO list root element"
        expected="valid"
        id="root"&gt;
        &lt;todo:list/&gt;
    &lt;/tf:case&gt;
    &lt;tf:case
        title="TODO list with a title"
        expected="valid"
        id="list-title"&gt;
        &lt;todo:list&gt;
            &lt;todo:title/&gt;
        &lt;/todo:list&gt;
    &lt;/tf:case&gt;
    &lt;tf:case
        title="Other root element"
        expected="error"
        id="other-root"&gt;
        &lt;todo:title&gt;A title&lt;/todo:title&gt;
    &lt;/tf:case&gt;
&lt;/tf:suite&gt;</pre>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Now that we&#8217;ve updated the test suite, we run it again.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="figure">
<p><a name="d5e128"></a></p>
<p class="title"><strong>Figure 4. Test results</strong></p>
<div class="figure-contents">
<div class="mediaobject"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/Bal2012vlis1215004.png" alt="Test results" /></div>
<div class="caption">
<p>Test results</p>
</div>
</div>
</div>
<p>&nbsp;</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">You see? We do already support list title elements!</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Sure, but I don&#8217;t want to accept any content in my todo list. And the title element should be mandatory. And it should not be empty by have at least one character!</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Back to the test suite, then&#8230;</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<p>Test suite</p>
<p>(suite.xml):</p>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;tf:suite
    xmlns:tf="http://xmlschemata.org/test-first/"
    xmlns:todo="http://balisage.net/todo#"
    title="Basic tests"&gt;
    &lt;tf:validation
        href="todo.xsd"
        type="xsd"/&gt;
    &lt;todo:list&gt;
        &lt;tf:case
            title="Empty list element"
            expected="error"
            id="root-empty"/&gt; 
        &lt;todo:title&gt;
            &lt;tf:case title="empty title" expected="error" id="empty-title"/&gt;
            &lt;tf:case title="non empty title" expected="valid" id="non-empty-title"&gt;A title&lt;/tf:case&gt;
        &lt;/todo:title&gt;
        &lt;tf:case
            title="Un expected element"
            expected="error"
            id="unexpected"&gt;
            &lt;todo:foo/&gt;
        &lt;/tf:case&gt;
    &lt;/todo:list&gt;
    &lt;tf:case
        title="Other root element"
        expected="error"
        id="other-root"&gt;
        &lt;todo:title&gt;A title&lt;/todo:title&gt;
    &lt;/tf:case&gt;
&lt;/tf:suite&gt;</pre>
<div class="note1" style="margin-left: 0.5in; margin-right: 0.5in;">
<table summary="Note" border="0">
<tbody>
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/note.png" alt="A note" /></td>
<th align="left">Note</th>
</tr>
<tr>
<td align="left" valign="top">This is the first example with non top level <code class="code">tf:case</code> elements. To understand how this works, we must look in more detail to the algorithm used by the framework to split a test suite into instances. The algorithm consists in two steps:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem">Loop over each <code class="code">tf:case</code> element</li>
<li class="listitem">Suppression of the <code class="code">tf:case</code>elements and of the top level elements which arenot ancestors of the current <code class="code">tf:case</code> element.</li>
</ul>
</div>
<p>This description may look complex, but the result is a rather intuitive way to define sub-trees that are common to several test cases.</td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Now that we&#8217;ve updated the test suite, we run it again.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="figure">
<p><a name="d5e162"></a></p>
<p class="title"><strong>Figure 5. Test results</strong></p>
<div class="figure-contents">
<div class="mediaobject"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/Bal2012vlis1215005.png" alt="Test results" /></div>
<div class="caption">
<p>Test results</p>
</div>
</div>
</div>
<p>&nbsp;</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Sounds good, now we can update the schema.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="http://balisage.net/todo#"
    xmlns="http://balisage.net/todo#"&gt;

    &lt;xs:element
        name="list"&gt;
        &lt;xs:complexType&gt;
            &lt;xs:sequence&gt;
                &lt;xs:element
                    name="title"&gt;
                    &lt;xs:simpleType&gt;
                        &lt;xs:restriction
                            base="xs:token"&gt;
                            &lt;xs:minLength
                                value="1"/&gt;
                        &lt;/xs:restriction&gt;
                    &lt;/xs:simpleType&gt;
                &lt;/xs:element&gt;
            &lt;/xs:sequence&gt;
        &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
&lt;/xs:schema&gt;</pre>
<p>todo.xsd</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">And run the test suite again.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="figure">
<p><a name="d5e179"></a></p>
<p class="title"><strong>Figure 6. Test results</strong></p>
<div class="figure-contents">
<div class="mediaobject"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/Bal2012vlis121506.png" alt="Test results" /></div>
</div>
</div>
<p>&nbsp;</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e184"></a>Step 4: Adding todo item elements</h2>
</div>
</div>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Good. Now I want to add todo items. And lists should have at least one of them, by the way.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Sure, back to the test suite&#8230;</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<p>Test suite</p>
<p>(suite.xml):</p>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;tf:suite
    xmlns:tf="http://xmlschemata.org/test-first/"
    xmlns:todo="http://balisage.net/todo#"
    title="Basic tests"&gt;
    &lt;tf:validation
        href="todo.xsd"
        type="xsd"/&gt;
    &lt;tf:case
        title="Empty list element"
        expected="error"
        id="root-empty"&gt;
        &lt;todo:list/&gt;
    &lt;/tf:case&gt;
    &lt;todo:list&gt;
        &lt;!-- Testing title elements --&gt;
        &lt;todo:title&gt;
            &lt;tf:case
                title="empty title"
                expected="error"
                id="empty-title"/&gt;
            &lt;tf:case
                title="non empty title"
                expected="valid"
                id="non-empty-title"&gt;A title&lt;/tf:case&gt;
        &lt;/todo:title&gt;
        &lt;todo:item&gt;
            &lt;todo:title&gt;A title&lt;/todo:title&gt;
        &lt;/todo:item&gt;
        &lt;tf:case
            title="Un expected element"
            expected="error"
            id="unexpected"&gt;
            &lt;todo:foo/&gt;
        &lt;/tf:case&gt;
    &lt;/todo:list&gt;
    &lt;todo:list&gt;
        &lt;!-- Testing todo items --&gt;
        &lt;todo:title&gt;Testing todo items&lt;/todo:title&gt;
        &lt;tf:case
            title="No todo items"
            expected="error"
            id="no-items"/&gt;
        &lt;todo:item&gt;
            &lt;tf:case
                title="empty item"
                expected="error"
                id="empty-item"/&gt;
            &lt;tf:case
                title="item with a title"
                expected="valid"
                id="item-title"&gt;
                &lt;todo:title&gt;A title&lt;/todo:title&gt;
            &lt;/tf:case&gt;
        &lt;/todo:item&gt;
    &lt;/todo:list&gt;
    &lt;tf:case
        title="Other root element"
        expected="error"
        id="other-root"&gt;
        &lt;todo:title&gt;A title&lt;/todo:title&gt;
    &lt;/tf:case&gt;
&lt;/tf:suite&gt;</pre>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Let&#8217;s see what we get before any update to the schema:</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="figure">
<p><a name="d5e199"></a></p>
<p class="title"><strong>Figure 7. Test results</strong></p>
<div class="figure-contents">
<div class="mediaobject"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/Bal2012vlis1215007.png" alt="Test results" /></div>
<div class="caption">
<p>Test results</p>
</div>
</div>
</div>
<p>&nbsp;</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">It&#8217;s time to update the schema and fix what needs to be fixed:</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="http://balisage.net/todo#"
    xmlns="http://balisage.net/todo#"&gt;

    &lt;xs:element
        name="list"&gt;
        &lt;xs:complexType&gt;
            &lt;xs:sequence&gt;
                &lt;xs:element
                    name="title"&gt;
                    &lt;xs:simpleType&gt;
                        &lt;xs:restriction
                            base="xs:token"&gt;
                            &lt;xs:minLength
                                value="1"/&gt;
                        &lt;/xs:restriction&gt;
                    &lt;/xs:simpleType&gt;
                &lt;/xs:element&gt;
                &lt;xs:element
                    maxOccurs="unbounded"
                    name="item"&gt;
                    &lt;xs:complexType&gt;
                        &lt;xs:sequence&gt;
                            &lt;xs:element
                                name="title"&gt;
                                &lt;xs:simpleType&gt;
                                    &lt;xs:restriction
                                        base="xs:token"&gt;
                                        &lt;xs:minLength
                                            value="1"/&gt;
                                    &lt;/xs:restriction&gt;
                                &lt;/xs:simpleType&gt;
                            &lt;/xs:element&gt;
                        &lt;/xs:sequence&gt;
                    &lt;/xs:complexType&gt;
                &lt;/xs:element&gt;
            &lt;/xs:sequence&gt;
        &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
&lt;/xs:schema&gt;</pre>
<p>todo.xsd</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">And now we can check if we get it right.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="figure">
<p><a name="d5e216"></a></p>
<p class="title"><strong>Figure 8. Test results</strong></p>
<div class="figure-contents">
<div class="mediaobject"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/Bal2012vlis1215008.png" alt="Test results" /></div>
<div class="caption">
<p>Test results</p>
</div>
</div>
</div>
<p>&nbsp;</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e223"></a>Step 5: Modularizing the schema</h2>
</div>
</div>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Eric, you should be ashamed, it&#8217;s a pure Russian doll schema, not modular at all! Why not define the title and list elements globally?</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Sure, we can do that! If we just change the structure of the schema, we don&#8217;t need to update the test suite and can work directly on the schema:</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="http://balisage.net/todo#"
    xmlns="http://balisage.net/todo#"&gt;

    &lt;xs:element
        name="list"&gt;
        &lt;xs:complexType&gt;
            &lt;xs:sequence&gt;
                &lt;xs:element
                    ref="title"/&gt;
                &lt;xs:element
                    maxOccurs="unbounded"
                    ref="item"/&gt;
            &lt;/xs:sequence&gt;
        &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
    &lt;xs:element
        name="title"&gt;
        &lt;xs:simpleType&gt;
            &lt;xs:restriction
                base="xs:token"&gt;
                &lt;xs:minLength
                    value="1"/&gt;
            &lt;/xs:restriction&gt;
        &lt;/xs:simpleType&gt;
    &lt;/xs:element&gt;
    &lt;xs:element
        name="item"&gt;
        &lt;xs:complexType&gt;
            &lt;xs:sequence&gt;
                &lt;xs:element
                    ref="title"/&gt;
            &lt;/xs:sequence&gt;
        &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
&lt;/xs:schema&gt;</pre>
<p>todo.xsd</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">But of course, each time we update the schema we must check if we&#8217;ve not introduced any bug:</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="figure">
<p><a name="d5e238"></a></p>
<p class="title"><strong>Figure 9. Test results</strong></p>
<div class="figure-contents">
<div class="mediaobject"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/Bal2012vlis1215009.png" alt="Test results" /></div>
<div class="caption">
<p>Test results</p>
</div>
</div>
</div>
<p>&nbsp;</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Waoo, what&#8217;s happening now?</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Now that our elements are global in the schema, we accept a valid title as a root element. Is that what you want?</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">No way, a title is not a valid list!</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Then we have a number of options&#8230; We can go back to local elements and we can also add a schematron schema to check this constraint.</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Schematron is fine, we&#8217;ll probably find many other constraints to check in my todo lists anyway&#8230;</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">OK. We still don&#8217;t have to update the test suite since we&#8217;ve not changed our requirement. Let&#8217;s write this Schematron schema then:</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"&gt;
    &lt;ns uri="http://balisage.net/todo#" prefix="todo"/&gt;
    &lt;pattern&gt;
        &lt;rule context="/*"&gt;
            &lt;assert test="self::todo:list"&gt;The root element should be a todo:list&lt;/assert&gt;
        &lt;/rule&gt;
    &lt;/pattern&gt;
&lt;/schema&gt;</pre>
<p>todo.sch</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Saying that we don&#8217;t have to update the test suite wasn&#8217;t totally accurate because the schemas are referenced in ths test suite:</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<p>Test suite</p>
<p>(suite.xml):</p>
<pre class="programlisting brush: xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;tf:suite
    xmlns:tf="http://xmlschemata.org/test-first/"
    xmlns:todo="http://balisage.net/todo#"
    title="Basic tests"&gt;
    &lt;tf:validation
        href="todo.sch"
        type="sch"/&gt;
    &lt;tf:validation
        href="todo.xsd"
        type="xsd"/&gt;
    &lt;tf:case
        title="Empty list element"
        expected="error"
        id="root-empty"&gt;
        &lt;todo:list/&gt;
    &lt;/tf:case&gt;
    &lt;todo:list&gt;
        &lt;todo:title&gt;
            &lt;tf:case
                title="empty title"
                expected="error"
                id="empty-title"/&gt;
            &lt;tf:case
                title="non empty title"
                expected="valid"
                id="non-empty-title"&gt;A title&lt;/tf:case&gt;
        &lt;/todo:title&gt;
        &lt;todo:item&gt;
            &lt;todo:title&gt;A title&lt;/todo:title&gt;
        &lt;/todo:item&gt;
        &lt;tf:case
            title="Un expected element"
            expected="error"
            id="unexpected"&gt;
            &lt;todo:foo/&gt;
        &lt;/tf:case&gt;
    &lt;/todo:list&gt;
    &lt;todo:list&gt;
        &lt;todo:title&gt;Testing todo items&lt;/todo:title&gt;
        &lt;tf:case
            title="No todo items"
            expected="error"
            id="no-items"/&gt;
        &lt;todo:item&gt;
            &lt;tf:case
                title="empty item"
                expected="error"
                id="empty-item"/&gt;
            &lt;tf:case
                title="item with a title"
                expected="valid"
                id="item-title"&gt;
                &lt;todo:title&gt;A title&lt;/todo:title&gt;
            &lt;/tf:case&gt;
        &lt;/todo:item&gt;
    &lt;/todo:list&gt;
    &lt;tf:case
        title="Other root element"
        expected="error"
        id="other-root"&gt;
        &lt;todo:title&gt;A title&lt;/todo:title&gt;
    &lt;/tf:case&gt;
&lt;/tf:suite&gt;</pre>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Time to see if we&#8217;ve fixed our issue!</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Expert</span></td>
</tr>
</tbody>
</table>
</div>
<div class="figure">
<p><a name="d5e276"></a></p>
<p class="title"><strong>Figure 10. Test results</strong></p>
<div class="figure-contents">
<div class="mediaobject"><img src="http://eric.van-der-vlist.com/blog/wp-content/uploads/2012/08/Bal2012vlis1215010.png" alt="Test results" /></div>
<div class="caption">
<p>Test results</p>
</div>
</div>
</div>
<p>&nbsp;</p>
<div class="blockquote">
<table class="blockquote" style="width: 100%; cellspacing: 0; cellpadding: 0;" summary="Block quote" border="0">
<tbody>
<tr>
<td valign="top" width="10%"></td>
<td valign="top" width="80%">Great, we&#8217;ve made it, thanks!</td>
<td valign="top" width="10%"></td>
</tr>
<tr>
<td valign="top" width="10%"></td>
<td colspan="2" align="right" valign="top">&#8211;<span class="attribution">Customer</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both;"><a name="d5e287"></a>Want to try it?</h2>
</div>
</div>
</div>
<p>The application used to run the test suite and display its result is available at <a class="link" href="http://svn.xmlschemata.org/repository/downloads/tefisc/" target="_blank">http://svn.xmlschemata.org/repository/downloads/tefisc/</a>.</p>
<p>If you just want to understand how the test suite is split into XML instances, you can have a look at<a class="link" href="http://svn.xmlschemata.org/repository/downloads/tefisc/orbeon-resources/apps/tefisc/" target="_blank"> http://svn.xmlschemata.org/repository/downloads/tefisc/orbeon-resources/apps/tefisc/</a> .</p>
<p>In this directory:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem"><a class="link" href="http://svn.xmlschemata.org/repository/downloads/tefisc/orbeon-resources/apps/tefisc/split-tests.xsl" target="_blank">split-tests.xsl</a>is the XSLT transformation that splits a test suite into top levelelement test cases. This transformation has no dependence on Orbeon Forms and can be manuallyrun against a test suite.</li>
<li class="listitem"><a class="link" href="http://svn.xmlschemata.org/repository/downloads/tefisc/orbeon-resources/apps/tefisc/run-test.xpl" target="_blank">run-test.xpl</a> is the XPL pipeline that runs a test case.</li>
<li class="listitem"><a class="link" href="http://svn.xmlschemata.org/repository/downloads/tefisc/orbeon-resources/apps/tefisc/list-suites.xpl" target="_blank">list-suites.xpl</a> is the XPL pipeline that gives the list avaible test cases.</li>
<li class="listitem"><a class="link" href="http://svn.xmlschemata.org/repository/downloads/tefisc/orbeon-resources/apps/tefisc/view.xhtml" target="_blank">view.xhtml</a> is the XForms application that displays the results.</li>
</ul>
</div>
<p>To install this application:</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc;">
<li class="listitem"><a class="link" href="http://wiki.orbeon.com/forms/doc/developer-guide/admin/installing" target="_blank">Install</a>Orbeon Forms</li>
<li class="listitem">copy the <a class="link" href="http://svn.xmlschemata.org/repository/downloads/tefisc/orbeon-resources/" target="_blank">orbeon-resources/</a> directory under <code class="code">/WEB-INF/resources/apps/</code>in yourorbeon webapp directory</li>
<li class="listitem"><span class="bold"><strong>or</strong></span>, alternatively, copy the <a class="link" href="http://svn.xmlschemata.org/repository/downloads/tefisc/orbeon-resources/apps/tefisc/" target="_blank">tefisc/</a> directory wherever you want, edit <a class="link" href="http://svn.xmlschemata.org/repository/downloads/tefisc/orbeon-resources/web.xml.sav" target="_blank">web.xml.sav</a>to replace<code class="code">&lt;param-value&gt;/home/vdv/projects/tefisc/orbeon-resources&lt;/param-value&gt;</code>by the location of this directory on your filesystem, replace <code class="code">/WEB-INF/web.xml </code>by this file and restart your application server.</li>
</ul>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2012/08/07/schema-test-driven-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using XSLTUnit with XSLT 2.0</title>
		<link>http://eric.van-der-vlist.com/blog/2012/04/28/using-xsltunit-with-xslt-2-0/</link>
		<comments>http://eric.van-der-vlist.com/blog/2012/04/28/using-xsltunit-with-xslt-2-0/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 20:01:08 +0000</pubDate>
		<dc:creator>Eric van der Vlist</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://eric.van-der-vlist.com/blog/?p=662</guid>
		<description><![CDATA[The latest version of XSLTUnit (v0.2) is from January 2002 and people sometimes ask me if the project is dead and when XSLTUnit will support XSLT 2.0. The short answer is that you can already use XSLTUnit with XSLT 2.0. &#8230; <a href="http://eric.van-der-vlist.com/blog/2012/04/28/using-xsltunit-with-xslt-2-0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The latest version of <a href="http://xsltunit.org">XSLTUnit</a> (v0.2) is from January 2002 and people sometimes ask me if the project is dead and when XSLTUnit will support XSLT 2.0.</p>
<p>The short answer is that you can already use XSLTUnit with XSLT 2.0.</p>
<p>The project is not dead and if I haven&#8217;t published any new version it&#8217;s just because XSLTUnit meets my needs and nobody has ever asked me any update.</p>
<p>I use it a lot and, no later than this afternoon, came on a new opportunity to use it to add unit tests to a function that I needed to debug for the <a href="http://owark.org/">Owark</a> project.</p>
<p>Following <a href="http://owark.org/2012/04/14/whats-next-for-owark/">ideas to develop a web service to create page archives</a>, I was writing an <a href="http://eric.van-der-vlist.com/blog/owark/1124">XSLT transformation</a> that analyses <a href="http://en.wikipedia.org/wiki/Heritrix">Heritrix</a> crawl logs to determine what needs to be packaged into the archives and one of the touchy functions is to create user friendly local names that remains unique within the scope of an archive.</p>
<p>My first naive attempt didn&#8217;t survive real world tests and results were rather disappointing.</p>
<p>Using these results as a test suite was an obvious idea&#8230;</p>
<p>To do so, I have used <a href="http://eric.van-der-vlist.com/blog/owark/1122">log.xml</a>, a real crawl log converted to XML as my source document and <a href="http://owark.org/trac/browser/archiver/pipelines/test/local-names.xml">local-names.xml</a>, the result of the transformation, as a reference.</p>
<p>The XSLTUnit transformation that exploit these documents, <a href="http://owark.org/trac/browser/archiver/pipelines/test/local-names.xsl">local-names.xsl</a>, is very simple and is a nice example of what you can do with this framework and how you can use it with XSLT 2.0.</p>
<p>An XSLTUnit test suite is an XSLT transformation that imports both the transformation to test and xsltunit.xsl:</p>
<pre class="brush:xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl" xmlns:xsltu="http://xsltunit.org/0/"
  xmlns:owk="http://owark.org/xslt/" exclude-result-prefixes="exsl"&gt;
  &lt;xsl:import href="../actions/resource-index.xslt"/&gt;
  &lt;xsl:import href="xsltunit.xsl"/&gt;

.../...

&lt;/xsl:stylesheet&gt;</pre>
<p>Here, the test suite and the XSLT transformation to test are both XSLT 2.0 and with Saxon they just work fine with xsltunit.xsl which is XSLT 1.0.</p>
<p>A XSLTUnit test case is composed of comparisons, and a test case to test that the value of the owk:local-name() function on a specific log entry is equal to &#8220;index.xml&#8221; could be:</p>
<pre class="brush:xml">      &lt;xsltu:test id="index"&gt;
        &lt;xsl:call-template name="xsltu:assertEqual"&gt;
          &lt;xsl:with-param name="id" select="'index'"/&gt;
          &lt;xsl:with-param name="nodes1"&gt;
            &lt;name&gt;
              &lt;xsl:value-of select="owk:local-name(/log/entry[uri='http://eric.van-der-vlist.com/blog/'])"/&gt;
            &lt;/name&gt;
          &lt;/xsl:with-param&gt;
          &lt;xsl:with-param name="nodes2"&gt;
            &lt;name&gt;index.html&lt;/name&gt;
          &lt;/xsl:with-param&gt;
        &lt;/xsl:call-template&gt;
      &lt;/xsltu:test&gt;</pre>
<p>This crawl log includes 292 resources and you wouldn&#8217;t want to copy and past 291 times this snippet&#8230; No problem, you can just use some XSLT power and write:</p>
<pre class="brush:xml"> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl" xmlns:xsltu="http://xsltunit.org/0/"
  xmlns:owk="http://owark.org/xslt/" exclude-result-prefixes="exsl"&gt;
  &lt;xsl:import href="../actions/resource-index.xslt"/&gt;
  &lt;xsl:import href="xsltunit.xsl"/&gt;
  &lt;xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/&gt;
  &lt;xsl:variable name="local-names" select="doc('local-names.xml')/index"/&gt;
  &lt;xsl:key name="log-by-uri" match="/log/entry" use="uri"/&gt;
  &lt;xsl:template match="/"&gt;
    &lt;xsltu:tests&gt;
      &lt;xsl:for-each select="$local-names/resource"&gt;
        &lt;xsltu:test id="{uri}"&gt;
          &lt;xsl:call-template name="xsltu:assertEqual"&gt;
            &lt;xsl:with-param name="id" select="uri"/&gt;
            &lt;xsl:with-param name="nodes1"&gt;
              &lt;local-name&gt;
                &lt;xsl:value-of select="owk:unique-local-name(key('log-by-uri', current()/uri, $source ))"/&gt;
              &lt;/local-name&gt;
            &lt;/xsl:with-param&gt;
            &lt;xsl:with-param name="nodes2"&gt;
              &lt;xsl:copy-of select="local-name"/&gt;
            &lt;/xsl:with-param&gt;
          &lt;/xsl:call-template&gt;
        &lt;/xsltu:test&gt;
      &lt;/xsl:for-each&gt;
    &lt;/xsltu:tests&gt;
  &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;</pre>
<p>When you&#8217;ve done so, you can edit &#8220;local-names.xml&#8221; that contains the expected values so that they look more like what you want to, run the test suite to detect the differences, update your transformation accordingly and iterate.</p>
]]></content:encoded>
			<wfw:commentRss>http://eric.van-der-vlist.com/blog/2012/04/28/using-xsltunit-with-xslt-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
