<?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>Marwan KHELIF &#187; XML</title>
	<atom:link href="http://www.mkhelif.fr/tag/xml/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mkhelif.fr</link>
	<description>Le blog d&#039;un développeur</description>
	<lastBuildDate>Sun, 25 Jul 2010 21:30:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HTML 5 : deux nouveaux documents</title>
		<link>http://www.mkhelif.fr/2009/02/18/html-5-deux-nouveaux-documents.html</link>
		<comments>http://www.mkhelif.fr/2009/02/18/html-5-deux-nouveaux-documents.html#comments</comments>
		<pubDate>Wed, 18 Feb 2009 13:57:34 +0000</pubDate>
		<dc:creator>mkhelif</dc:creator>
				<category><![CDATA[Actualités]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://www.mkhelif.fr/2009/02/18/html-5-deux-nouveaux-documents.html</guid>
		<description><![CDATA[Le W3C (World Wide Web Consortium, consortium chargé de promouvoir la compatibilité des technologies Web) vient de publier deux nouveaux documents traitant de la version 5 de HTML. La version 4 de HTML a été figée en 1997 et la version 5 est en développement depuis 2004.
L&#8217;un des documents présente la liste des différences entre [...]]]></description>
			<content:encoded><![CDATA[<p>Le <a href="http://www.w3.org/" target="_blank">W3C</a> (World Wide Web Consortium, consortium chargé de promouvoir la compatibilité des technologies Web) vient de publier deux nouveaux documents traitant de la version 5 de HTML. La version 4 de HTML a été figée en 1997 et la version 5 est en développement depuis 2004.</p>
<p>L&#8217;un des documents présente la liste des <a href="http://www.w3.org/TR/html5-diff/" target="_blank">différences entre HTML 4 et HTML 5</a> (liste évidement non exhaustive) :</p>
<ul>
<li>Le langage est basé sur l&#8217;utilisation des documents DOM.</li>
<li>Concept de contextes de navigation.</li>
<li>Nouveaux concepts de modèles de contenu (remplaçant les actuels <em>block</em> et <em>inline</em>).</li>
<li>Nouveaux éléments : <em>datagrid</em>, <em>menu</em> (pour l&#8217;utilisation en natif de menu contextuel), <em>commands</em>.</li>
<li>Gestion du cache pour les applications Web en mode déconnecté (concept de Google Gears?).</li>
<li>Concept de <em>UndoManager</em>, permettant de gérer l&#8217;undo/redo.</li>
<li>Architecture de copier/coller et drag&amp;drop.</li>
<li>Nouveaux éléments permettant d&#8217;embarquer du contenu vidéo, canvas (pour les graphes 2D, les jeux, &#8230;).</li>
<li>Nouveaux types d&#8217;élément <em>input</em> : date, number, email, url, color, &#8230;L&#8217;élément <em>input</em> a aussi droit à un nouvel attribut : <em>autofocus</em>, permettant de lui donner directement le focus lors du chargement de la page.</li>
<li>Suppression des éléménts <em>frame</em>, <em>frameset </em>et <em>noframe</em>, car ils dégradent l&#8217;utilisation et l&#8217;accessibilité du site.</li>
</ul>
<p>HTML 5 sera évidement compatible avec les pages en HTML 4. Cette nouvelle version a aussi pour but de standardiser toutes les API JavaScript grâce à un référentiel commun.</p>
<p>L&#8217;autre document est la <a href="http://www.w3.org/TR/html5/" target="_blank">spécification complète de HTML 5</a>.<br />
<h3>Pour suivre votre lecture</h3>
<ul class="related_post">
<li><a href="http://www.mkhelif.fr/2010/01/14/gwt-2-0-les-nouvelles-fonctionnalits.html" title="GWT 2.0 : les nouvelles fonctionnalités">GWT 2.0 : les nouvelles fonctionnalités</a></li>
<li><a href="http://www.mkhelif.fr/2009/12/15/goo-gl-le-raccourcisseur-durl-by-google.html" title="Goo.gl : le raccourcisseur d&rsquo;URL by Google">Goo.gl : le raccourcisseur d&rsquo;URL by Google</a></li>
<li><a href="http://www.mkhelif.fr/2009/11/19/chrome-os-premire-prsentation.html" title="Chrome OS : premi&egrave;re pr&eacute;sentation">Chrome OS : premi&egrave;re pr&eacute;sentation</a></li>
<li><a href="http://www.mkhelif.fr/2009/10/20/guide-doptimisation-de-vos-applications-web.html" title="Guide d&rsquo;optimisation de vos applications Web">Guide d&rsquo;optimisation de vos applications Web</a></li>
<li><a href="http://www.mkhelif.fr/2009/09/18/twitter-la-voip-disponible-grce-jajah.html" title="Twitter : la VoIP disponible gr&acirc;ce &agrave; Jajah">Twitter : la VoIP disponible gr&acirc;ce &agrave; Jajah</a></li>
<li><a href="http://www.mkhelif.fr/2009/09/12/cinq-moyens-pour-grer-son-identit-virtuelle.html" title="Cinq moyens pour g&eacute;rer son identit&eacute; virtuelle">Cinq moyens pour g&eacute;rer son identit&eacute; virtuelle</a></li>
<li><a href="http://www.mkhelif.fr/2009/09/07/ruby-on-rails-dployer-une-application-sur-tomcat-avec-jruby.html" title="Ruby on Rails : d&eacute;ployer une application sur Tomcat avec JRuby">Ruby on Rails : d&eacute;ployer une application sur Tomcat avec JRuby</a></li>
</ul>
       ]]></content:encoded>
			<wfw:commentRss>http://www.mkhelif.fr/2009/02/18/html-5-deux-nouveaux-documents.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nouveautés Java 7 &#8211; Dolphin</title>
		<link>http://www.mkhelif.fr/2008/03/17/nouveautes-java-7-dolphin.html</link>
		<comments>http://www.mkhelif.fr/2008/03/17/nouveautes-java-7-dolphin.html#comments</comments>
		<pubDate>Mon, 17 Mar 2008 17:58:35 +0000</pubDate>
		<dc:creator>mkhelif</dc:creator>
				<category><![CDATA[Actualités]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://wiki.mkhelif.fr/2008/03/17/nouveautes-java-7-dolphin.html</guid>
		<description><![CDATA[Il n&#8217;y à toujours pas de JSR officiel décrivant l&#8217;ensemble des nouvelles fonctionnalités de Java 7. Cette dernière version porte toujours le nom d&#8217;un animal : Dolphin.
Pour cette nouvelle version il devrait y avoir des évolutions dans le langages Java,  un nouveau format d&#8217;archive (remplaçant du fichier jar) : Java Module System (JSR 277), [...]]]></description>
			<content:encoded><![CDATA[<p>Il n&#8217;y à toujours pas de JSR officiel décrivant l&#8217;ensemble des nouvelles fonctionnalités de Java 7. Cette dernière version porte toujours le nom d&#8217;un animal : Dolphin.</p>
<p>Pour cette nouvelle version il devrait y avoir des évolutions dans le langages Java,  un nouveau format d&#8217;archive (remplaçant du fichier jar) : Java Module System (<a href="http://jcp.org/en/jsr/detail?id=277" title="JSR 277" target="_blank">JSR 277</a>), de nouvelles API et des améliorations de la JVM (support natif de language de script : Javascript, Ruby, PHP).</p>
<p><span id="more-43"></span></p>
<h2> Nouveautés du langage</h2>
<ul>
<li><strong>Support natif du XML :</strong></li>
</ul>
<p>Un exemple vaut mieux que plusieurs lignes d&#8217;explications :</p>

<div class="wp_codebox"><table><tr id="p439"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p43code9"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">Document</span> d <span style="color: #339933;">=</span> <span style="color: #339933;">&lt;</span>collection<span style="color: #339933;">&gt;&lt;</span>object param<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;value&quot;</span><span style="color: #339933;">&gt;</span>Content<span style="color: #339933;">&lt;/</span>object<span style="color: #339933;">&gt;&lt;/</span>collection<span style="color: #339933;">&gt;;</span>
element.<span style="color: #006633;">appendChild</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;</span>object<span style="color: #339933;">&gt;</span>Content<span style="color: #339933;">&lt;/</span>object<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<ul>
<li><strong>Propriétés JavaBeans :</strong></li>
</ul>
<p>Possibilité de définir un membre d&#8217;une classe en tant que propriété : les accesseurs seront alors générés à la compilation. Actuellement la syntaxe permettant d&#8217;accèder aux accesseurs n&#8217;est pas encore certaines : <strong>.</strong>, <strong>=&gt;</strong>, <strong>-&lt;</strong>, <strong>#</strong>.</p>

<div class="wp_codebox"><table><tr id="p4310"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p43code10"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyObject <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> property <span style="color: #003399;">String</span> member<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
...
<span style="color: #006633;">MyObject</span> obj <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyObject <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
obj.<span style="color: #006633;">member</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;NewValue&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// setMember</span>
<span style="color: #003399;">String</span> str <span style="color: #339933;">=</span> obj<span style="color: #339933;">=&gt;</span>member<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// getMember</span>
obj<span style="color: #339933;">-&gt;</span>member <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;New Value&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// setMember</span>
str <span style="color: #339933;">=</span> obj#member<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// getMember</span></pre></td></tr></table></div>

<ul>
<li><strong>Redéfinition des opérateurs :</strong></li>
</ul>
<p>Le langage permettrait alors de redéfinir les opérateurs grâce à des annotations.</p>

<div class="wp_codebox"><table><tr id="p4311"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p43code11"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">String</span> str <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;first&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span>str<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #0000ff;">&quot;first&quot;</span><span style="color: #339933;">:</span> doThis <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #0000ff;">&quot;second&quot;</span><span style="color: #339933;">:</span> doThat <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">default</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">IllegalArgumentException</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Unknown: &quot;</span> <span style="color: #339933;">+</span> str<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Autre exemple avec les énumérations :</p>

<div class="wp_codebox"><table><tr id="p4312"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p43code12"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">enum</span> MyColor <span style="color: #009900;">&#123;</span>
    EMPTY,
    BLACK, WHITE,
    RED, YELLOW, BLUE,
    PINK, PURPLE, ORANGE, GREY<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> isPrimary <span style="color: #009900;">&#40;</span>MyColor c<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">return</span> c <span style="color: #339933;">&gt;=</span> MyColor.<span style="color: #006633;">RED</span> <span style="color: #339933;">&amp;</span>#038<span style="color: #339933;">;&amp;</span> c <span style="color: #339933;">&lt;</span> <span style="color: #339933;">=</span> MyColor.<span style="color: #006633;">BLUE</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<ul>
<li><strong>Chaînage des appels de méthodes :</strong></li>
</ul>
</pre>

<div class="wp_codebox"><table><tr id="p4313"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p43code13"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> MyObject <span style="color: #009900;">&#123;</span>
     <span style="color: #000066; font-weight: bold;">void</span> doSomething <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> ... <span style="color: #009900;">&#125;</span>
     <span style="color: #000066; font-weight: bold;">void</span> doOther <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> ... <span style="color: #009900;">&#125;</span>
     <span style="color: #000066; font-weight: bold;">boolean</span> validate <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> ... <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
MyObjet myObject <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyObject <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">boolean</span> validate <span style="color: #339933;">=</span> myObject.<span style="color: #006633;">doSomething</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">doOther</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">validate</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<ul>
<li><strong>Amélioration des blocs <em>catch</em> :</strong></li>
</ul>

<div class="wp_codebox"><table><tr id="p4314"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p43code14"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
     doSomething <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IllegalStateException</span> <span style="color: #339933;">|</span> <span style="color: #003399;">IllegalAccessException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #666666; font-style: italic;">// Traitement de l'exception...</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
    doOther <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Lance des types différences d'exceptions</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">Throwable</span> t<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">throw</span> t<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Lance les mêmes types d'exceptions</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<ul>
<li><strong>Gestion automatique des ressources :</strong> les ressources qui sont initialisées dans un bloc sont automatiquement nettoyées à la fin du bloc. Le bloc <em>finally</em> n'est alors plus nécessaire.</li>
<li><strong>Simplification des templates et des List/Map :</strong></li>
</ul>

<div class="wp_codebox"><table><tr id="p4315"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p43code15"><pre class="java" style="font-family:monospace;">Map<span style="color: #339933;">&lt;</span>string , Object<span style="color: #339933;">&gt;</span> myMap <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HashMap<span style="color: #339933;">&lt;&gt;</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
List<span style="color: #339933;">&lt;/</span>string<span style="color: #339933;">&gt;&lt;</span>string<span style="color: #339933;">&gt;</span> list <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ArrayList<span style="color: #339933;">&lt;&gt;</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
list.<span style="color: #006633;">add</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;First&quot;</span><span style="color: #339933;">;</span>
list.<span style="color: #006633;">add</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Second&quot;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>string<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<ul>
<li><strong>Les <em>Closures</em> (ou méthodes anonymes) :</strong></li>
</ul>

<div class="wp_codebox"><table><tr id="p4316"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code" id="p43code16"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Sans Closures :</span>
lock.<span style="color: #006633;">lock</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #339933;">++</span>counter<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">finally</span> <span style="color: #009900;">&#123;</span>
    lock.<span style="color: #006633;">unlock</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Avec Closures :</span>
withLock <span style="color: #009900;">&#40;</span>lock<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #339933;">++</span>counter<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #339933;">&lt;</span>t<span style="color: #339933;">&gt;</span> T withLock <span style="color: #009900;">&#40;</span>Lock lock, <span style="color: #009900;">&#123;</span><span style="color: #339933;">=&gt;</span> T <span style="color: #000000; font-weight: bold;">throws</span> E<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> block<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> E <span style="color: #009900;">&#123;</span>
    lock.<span style="color: #006633;">lock</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// Exécution du 'bloc' de code block</span>
        <span style="color: #000000; font-weight: bold;">return</span> block.<span style="color: #006633;">invoke</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">finally</span> <span style="color: #009900;">&#123;</span>
        lock.<span style="color: #006633;">unlock</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>t<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<h2>Modularité</h2>
<ul>
<li><strong>Gestion des Super packages.</strong></li>
<li><strong>JA</strong>va <strong>M</strong>odule System : remplaçant du fichier JAR (<strong>J</strong>ava <strong>AR</strong>chive) : gestion des versions, des dépendances, ...</li>
</ul>
<h4>Gestion du versionning</h4>
<p style="text-align: left">Lorsque l'on développe une application, celle ci à généralement besoins d'une ou plusieurs librairies de classes. Cependant si cette librairie ne peut être fourni avec l'application (problème de license) ou qu'une version spécifique est nécessaire, il n'y à actuellement aucun moyen simple de vérifier la librairie.  Les fichiers JAM vont permettrent ceci grâce à une gestion avancée du versionning :</p>
<pre>major[.minor[.micro[.update]]][-qualifier]</pre>
<p>Par exemple :</p>
<table style="border: 1px solid #444444; text-align: left" cellpadding="0" cellspacing="0">
<tr>
<td style="border-bottom: 1px solid #444444">1+</td>
<td style="border-bottom: 1px solid #444444">Version 1 ou supérieur</td>
<td style="border-bottom: 1px solid #444444">(1 < = x)</td>
</td>
</tr>
<tr>
<td style="border-bottom: 1px solid #444444">1.5+</td>
<td style="border-bottom: 1px solid #444444">Version 1.5 ou supérieur</td>
<td style="border-bottom: 1px solid #444444">(1.5 < = x)</td>
</td>
</tr>
<tr>
<td style="border-bottom: 1px solid #444444">1.5.2+</td>
<td style="border-bottom: 1px solid #444444">Version 1.5.2 ou supérieur</td>
<td style="border-bottom: 1px solid #444444">(1.5.2 < = x)</td>
</td>
</tr>
<tr>
<td style="border-bottom: 1px solid #444444">1*</td>
<td style="border-bottom: 1px solid #444444">Toutes les versions de la branche 1.</td>
<td style="border-bottom: 1px solid #444444">(1 < = x < 2)</td>
</td>
</tr>
<tr>
<td style="border-bottom: 1px solid #444444">1.5*</td>
<td style="border-bottom: 1px solid #444444">Toutes les versions de la branche 1.5.</td>
<td style="border-bottom: 1px solid #444444">(1.5 < = x < 1.6)</td>
</td>
</tr>
<tr>
<td style="border-bottom: 1px solid #444444">1.5.2*</td>
<td style="border-bottom: 1px solid #444444">Toutes les versions de la branche 1.5.2.</td>
<td style="border-bottom: 1px solid #444444">(1.5.2 < = x < 1.5.3)</td>
</td>
</tr>
<tr>
<td style="border-bottom: 1px solid #444444">1.[5+]</td>
<td style="border-bottom: 1px solid #444444">Version 1.5 ou supérieur dans la branche 1.</td>
<td style="border-bottom: 1px solid #444444">(1.5 < = x < 2)</td>
</td>
</tr>
<tr>
<td style="border-bottom: 1px solid #444444">1.5.[2+]</td>
<td style="border-bottom: 1px solid #444444">Version 1.5.2 ou supérieur dans la branche 1.5.</td>
<td style="border-bottom: 1px solid #444444">(1.5.2 < = x < 1.6)</td>
</td>
</tr>
<tr>
<td style="border-bottom: 1px solid #444444">1.[5.2+]</td>
<td style="border-bottom: 1px solid #444444">Version 1.5.2 ou supérieur dans la branche 1.</td>
<td style="border-bottom: 1px solid #444444">(1.5.2 < = x < 2)</td>
</td>
</tr>
</table>
<h4>Modules</h4>
<p style="text-align: left">Un fichier JAM est en fait une simple archive (tout comme le fichier JAR) qui peut contenir d'autres JAR (les modules), des ressources (images, ...), du code natif (nouvelle gestion : <em>/META-INF/bin/</p>
<platform>/<arch>/</arch></platform></em>), des métas-données : <em>MODULE-INF/METADATA.module</em> (version, classe principale, modules nécessaires, attributs, superpackages).</p>
<p style="text-align: left">Chaque application aura une bibliothèque de modules (locaux ou distants) permettant la recherche, le chargement (au démarrage ou à l'exécution).</p>
<p>Exemple :</p>
<pre code="java">// Déclaration du superpackage :
@Version("1.0")
superpackage com.site.pack {

    // Import de modules
    @VersionConstraint("1.0+")
    import com.site.name;
    @VersionConstraint("1.5*")
    import com.site.xml;

    // Liste des packages
    member package com.site.pack, com.site.pack.impl;

    // Types exportés
    export com.site.pack.*;
}</pre>
<h2>Nouvelles API</h2>
<ul style="text-align: left">
<li><strong>NIO 2</strong> : gestion avancée du système de fichiers (permissions, attributs de fichier), API I/O asynchrone pour les sockets et fichiers.</li>
<li><strong>JSR 275</strong> (gestion des unités, ex: Km, m, cm, ...) : expression d'une valeur dans plusieurs unités, conversion d'unités, parsing des unités dans une String.</li>
<li><strong>JSR 310</strong> (date and time API) : amélioration de l'API actuelle afin de permettre de gérer des durées, des intervalles.</li>
<li><strong>JSR 166y</strong> : amélioration de la concurrence.</li>
<li><strong>JSR 225</strong> : Xquery API for Java.</li>
<li><strong>JSR 284</strong> : gestion de la consommation des ressources (CPU, mémoire, connexions JDBC, ...).</li>
<li><strong>JSR 308</strong> : annotations sur les types Java.</li>
<li><strong>JSR 260</strong> (amélioration de la Javadoc) : tri des méthodes et champs en fonction de leur utilité, un index sémantique, distinction des méthodes/objets <em>static</em>, <em>factory</em>, <em>deprecated</em>, distinction des méthodes de propriétés (accesseurs), ajout d'exemples d'utilisation des méthodes.</li>
<li><strong>JSR 296</strong> (framework pour Swing) : sauvegarde de l'état entre chaque session, gestion simplifiée des actions (arrière-plan), génération des textes dans des fichiers <em>.properties</em> (localisation).</li>
<li><strong>JSR 303</strong> : validation des Beans (contraintes de schéma de base de données, du niveau business/service, du niveau présentation, du côté client).</li>
<li><strong>JSR 295</strong> : liaison des Beans.</li>
</ul>
<h2>JVM</h2>
<ul>
<li><strong>Amélioration du byte-code</strong> (gestion dynamique) afin de supporter des langages de scripts : Javascript, PHP, Ruby.</li>
<li><strong>Modification du Garbage Collector</strong> : plus de gestion d'ancienne et nouvelle génération.</li>
</ul>
<p>Article écrit à partir de : <a href="http://blog.xebia.fr/2008/02/20/nagez-avec-les-dauphins-jdk-7-proposals-overview/" title="Xebia" target="_blank">Xebia</a>.</p>
<h3>Pour suivre votre lecture</h3>
<ul class="related_post">
<li><a href="http://www.mkhelif.fr/2010/01/14/gwt-2-0-les-nouvelles-fonctionnalits.html" title="GWT 2.0 : les nouvelles fonctionnalités">GWT 2.0 : les nouvelles fonctionnalités</a></li>
<li><a href="http://www.mkhelif.fr/2009/09/07/ruby-on-rails-dployer-une-application-sur-tomcat-avec-jruby.html" title="Ruby on Rails : d&eacute;ployer une application sur Tomcat avec JRuby">Ruby on Rails : d&eacute;ployer une application sur Tomcat avec JRuby</a></li>
<li><a href="http://www.mkhelif.fr/2009/06/03/ouverture-du-java-store.html" title="Ouverture du Java Store">Ouverture du Java Store</a></li>
<li><a href="http://www.mkhelif.fr/2009/04/20/oracle-rachte-sun.html" title="Oracle rachète Sun">Oracle rachète Sun</a></li>
<li><a href="http://www.mkhelif.fr/2009/04/10/premire-utilisation-du-plugin-eclipse-gwt.html" title="Première utilisation du plugin Eclipse GWT">Première utilisation du plugin Eclipse GWT</a></li>
<li><a href="http://www.mkhelif.fr/2009/04/08/google-gwt-version-16-et-consorts.html" title="Google : GWT version 1.6 et consorts">Google : GWT version 1.6 et consorts</a></li>
<li><a href="http://www.mkhelif.fr/2009/02/18/html-5-deux-nouveaux-documents.html" title="HTML 5 : deux nouveaux documents">HTML 5 : deux nouveaux documents</a></li>
</ul>
       ]]></content:encoded>
			<wfw:commentRss>http://www.mkhelif.fr/2008/03/17/nouveautes-java-7-dolphin.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Validation XML</title>
		<link>http://www.mkhelif.fr/2008/01/03/validation-xml.html</link>
		<comments>http://www.mkhelif.fr/2008/01/03/validation-xml.html#comments</comments>
		<pubDate>Thu, 03 Jan 2008 10:21:52 +0000</pubDate>
		<dc:creator>mkhelif</dc:creator>
				<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://wiki.mkhelif.fr/beta/2008/01/03/validation-xml.html</guid>
		<description><![CDATA[Lors de l&#8217;utilisation du langage XML on voudrait que tous les documents que l&#8217;on va parser soit valide, c&#8217;est à dire qu&#8217;ils correspondent à un certain format. Cependant si l&#8217;utilisateur a accés à ces documents XML il faut pouvoir vérifier que le document est valide.
On peut réaliser cette vérification pendant le parsing mais cela ajoute [...]]]></description>
			<content:encoded><![CDATA[<p>Lors de l&#8217;utilisation du langage XML on voudrait que tous les documents que l&#8217;on va parser soit valide, c&#8217;est à dire qu&#8217;ils correspondent à un certain format. Cependant si l&#8217;utilisateur a accés à ces documents XML il faut pouvoir vérifier que le document est valide.<br />
On peut réaliser cette vérification pendant le parsing mais cela ajoute une tâche au développeur.</p>
<p>C&#8217;est pour cela qu&#8217;il existe des langages de validations, ils permettent de valider le format des documents XML selon un format qui est défini par le dévéloppeur.</p>
<p>La plupart des parseurs vérifient le format et renvoient une erreur si le format n&#8217;est pas respecté.</p>
<p><span id="more-31"></span></p>
<h2>Les langages de validations</h2>
<p>Il existe plusieurs langages de validations, mais je ne vais vous présenter que les deux les plus utilisés.</p>
<p>Les différents langages :</p>
<ul>
<li>DTD (<strong>D</strong>ocument <strong>T</strong>ype <strong>D</strong>efinition) : définition du type de document. Ce langage peut être inclu directement dans le document XML.</li>
<li>XML Schema : il permet de définir la structure d&#8217;un document avec plus de précision (type de donnée, nombre d&#8217;occurence, &#8230;).</li>
<li>Relax NG (<strong>RE</strong>gular <strong>LA</strong>nguage for <strong>X</strong>ML <strong>N</strong>ext <strong>G</strong>eneration) : ce langage ne spécifie que la structure du document, le type de donnée est sous-traitée à la bibliothèque de types de XML Schema.</li>
<li>Schematron : contrairement aux autres langages Schematron définie un modèle d&#8217;arbre du document XML, il utilise la même conception que XPath ou XSLT.</li>
</ul>
<h2>Doctype</h2>
<p>Une DTD est une grammaire permettant de vérifier la validité d&#8217;un document.<br />
Un document XML peut avoir une DTD incluse dans son entête ou bien indiquée le fichier où elle se situe.</p>
<p>Une DTD définit trois objets permettant de définir la grammaire :</p>
<ul>
<li> ELEMENT : représente un élément XML et permet de définir les sous-éléments ansi que leurs occurences.</li>
<li>ATTLIST : liste des attributs d&#8217;un élément.</li>
<li>ENTITY : permet de définir un &#8216;alias&#8217;.</li>
</ul>
<p>Une DTD est définie de la façon suivante :</p>
<pre>&lt;!DOCTYPE element-racine [
  &lt;!ELEMENT ...&gt;
  &lt;!ATTLIST ...&gt;
  &lt;!ENTITY ...&gt;
]&gt;</pre>
<p>Voici un site permettant de valider un fichier XML avec sa DTD : <a href="http://www.stg.brown.edu/service/xmlvalid/" title="Validateur XML" target="_blank">http://www.stg.brown.edu/service/xmlvalid/</a>.</p>
<h3>Élément</h3>
<p>Permet de définir un élément XML en spécifiant le nom les sous-éléments de ce dernier.<br />
La déclaration d&#8217;un ENTITY doit avoir la syntaxe suivante :</p>
<pre>&lt;!ELEMENT nom (Donnees)&gt;</pre>
<p>La définition des <strong>Donnees</strong> peut avoir les valeurs suivantes :</p>
<ul>
<li><strong>(#PCDATA)</strong> : l&#8217;élément contient des données de types textes mais ne peut pas contenir de sous-éléments.</li>
<li><strong>(Element1, Element2, &#8230;)</strong> : liste des sous-éléments que contient l&#8217;élément.</li>
<li><strong>(Element1 | Element2 | &#8230;)</strong> : liste des sous-éléments qui peuvent être contenus par cet élément.</li>
<li><strong>ANY</strong> : cet élément peut contenir n&#8217;importe quel type de données.</li>
<li><strong>EMPTY</strong> : cet élément doit être vide et ne peux contenir aucune donnée (texte ou éléments).</li>
</ul>
<p>Dans la définition des sous-éléments on peut spécifier l&#8217;occurence de l&#8217;élément :</p>
<ul>
<li><strong>Element1?</strong> : l&#8217;élément peut apparaître 0 ou 1 fois.</li>
<li><strong>Element1+</strong> : l&#8217;élément peut apparaître 1 ou plusieurs fois.</li>
<li><strong>Element1*</strong> : l&#8217;élément peut apparaître 0, 1 ou plusieurs fois.</li>
</ul>
<p>On peut spécifier le nombre de sous-élément en répétant l&#8217;élément enfant :</p>
<pre>&lt;!ELEMENT element1 (element2, element2)&gt;</pre>
<p>Ici l&#8217; &laquo;&nbsp;élément1&#8243; devra forcément contenir 2 éléments &laquo;&nbsp;element2&#8243;.</p>
<p>Voici un exemple de DTD d&#8217;une liste de contacts :</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&gt;
&lt;!DOCTYPE contacts [
  &lt;!ELEMENT contacts (contact*)&gt;
  &lt;!ELEMENT contact (nom, adresse, mail)&gt;
  &lt;!ELEMENT nom (#PCDATA)&gt;
  &lt;!ELEMENT adresse (#PCDATA)&gt;
  &lt;!ELEMENT mail (#PCDATA)&gt;
]&gt;</pre>
<pre>&lt;contacts&gt;
  &lt;contact&gt;
    &lt;nom&gt;Marwan KHELIF&lt;/nom&gt;
      &lt;adresse&gt;...&lt;/adresse&gt;
      &lt;mail&gt;mkhelif@gmail.com&lt;/mail&gt;
    &lt;/contact&gt;
  &lt;contact&gt;
      &lt;nom&gt;My Name&lt;/nom&gt;
      &lt;adresse&gt;My address&lt;/adresse&gt;
      &lt;mail&gt;my.mail@mail.com&lt;/mail&gt;
    &lt;/contact&gt;
  &lt;/contacts&gt;
&lt;/code&gt;</pre>
<h3>Attlist</h3>
<p>La déclaration ATTLIST permet de définir les attributs d&#8217;un élément. On peut spécifier le type de donnée, la valeur par défaut, forcer la présence de l&#8217;élément, &#8230;</p>
<p>La déclaration se fait ainsi :</p>
<pre>&lt;!ATTLIST nomElement nomAttribut Type ValeurDefaut&gt;</pre>
<p>Le nom de l&#8217;élément doit correspondre au nom d&#8217;un élément déclaré dans la DTD.</p>
<p>Le type de l&#8217;attribut peut prendre les valeurs suivantes :</p>
<ul>
<li><strong>CDATA</strong> : l&#8217;attribut contient des données textuelles.</li>
<li><strong>ID</strong> : chaqu&#8217;un des éléments définis doit avoir une valeur différente pour cet attribut.</li>
<li><strong>IDREF </strong>: référence la valeur d&#8217;un attribut <strong>ID</strong> d&#8217;un autre élémént.</li>
<li><strong>IDREFS </strong>: liste d&#8217;attributs <strong>ID</strong>, ses valeurs sont séparées par un espace.</li>
<li><strong>ENTITY </strong>: correspond à une ENTITY déclarée dans la DTD.</li>
<li><strong>ENTITIES </strong>: listes d&#8217;ENTITY déclarées dans la DTD, chaque ENTITY doit être séparées par un espace.</li>
<li><strong>NMTOKEN </strong>: la valeur doit être un nom XML valide.</li>
<li><strong>NMTOKENS </strong>: liste de noms XML valides.</li>
<li><strong>NOTATION</strong> : nom d&#8217;une notation définie dans la DTD.</li>
</ul>
<p>La valeur par défaut de l&#8217;attribut peut prendre les valeurs suivantes :</p>
<ul>
<li><strong><em>valeur</em></strong> : valeur par défaut de l&#8217;attribut.</li>
<li><strong>#REQUIRED</strong> : l&#8217;élément doit forcément posséder cet attribut.</li>
<li><strong>#IMPLIED</strong> : cet attribut n&#8217;est pas obligatoire.</li>
<li><strong>#FIXED <em>valeur</em></strong> : l&#8217;attribut doit forcément avoir la valeur <em>valeur</em>.</li>
</ul>
<p>Voilà un exemple de DTD définissant des attributs :</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&gt;
 &lt;!DOCTYPE personnes [
  &lt;!ELEMENT personnes (personne*)&gt;
  &lt;!ELEMENT personne (adresse, mail)&gt;
  &lt;!ATTLIST personne
       id ID #REQUIRED
       nom CDATA #REQUIRED
       sexe (homme | femme) "homme"&gt;</pre>
<pre>  &lt;!ELEMENT adresse (#PCDATA)&gt;
  &lt;!ATTLIST adresse
       code CDATA #REQUIRED&gt;</pre>
<pre>  &lt;!ELEMENT mail (#PCDATA)&gt; ]&gt;</pre>
<pre>&lt;personnes&gt;
  &lt;personne id="user0" nom="Marwan KHELIF"&gt;
    &lt;adresse code="13"&gt;...&lt;/adresse&gt;
    &lt;mail&gt;mkhelif@gmail.com&lt;/mail&gt;
  &lt;/personne&gt;
  &lt;personne id="user1" nom="MyName" sexe="femme"&gt;
    &lt;adresse code="01"&gt;...&lt;/adresse&gt;
    &lt;mail&gt;monMail@mail.com&lt;/mail&gt;
  &lt;/personne&gt;
&lt;/personnes&gt;</pre>
<h3>Entity</h3>
<p>La déclaration d&#8217;une ENTITY permet de créer un &#8216;alias&#8217;, elle est ensuite utilisable dans le document XML.</p>
<p>On la déclare de la façon suivante :</p>
<pre>&lt;!ENTITY nomEntity "valeur"&gt;</pre>
<p>On peut alors l&#8217;utiliser dans le document XML : <em>&amp;nomEntity;</em>, la valeur définie sera alors positionnée à la place de cet entité.</p>
<p>Par exemple :</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&gt;</pre>
<pre>&lt;!DOCTYPE articles [   &lt;!ENTITY auteur "Marwan KHELIF"&gt;
  &lt;!ENTITY dtd "Document Type Definition"&gt;
  &lt;!ENTITY xsd "XML Schema"&gt;</pre>
<pre>  &lt;!ELEMENT articles (article*)&gt;</pre>
<pre>  &lt;!ELEMENT article (#PCDATA)&gt;
  &lt;!ATTLIST article
       titre CDATA #REQUIRED
       auteur CDATA "&amp;auteur;"
       date CDATA #REQUIRED&gt;
]&gt;</pre>
<pre>&lt;articles&gt;
  &lt;article titre="&amp;dtd;" date="17/07/07"&gt;Presentation de &amp;dtd; par &amp;auteur;.&lt;/article&gt;
  &lt;article titre="&amp;xsd;" date="17/07/07"&gt;Presentation de &amp;xsd; par &amp;auteur;.&lt;/article&gt;
&lt;/articles&gt;</pre>
<p>Ce sont les entités générales du document, il y a un autre type d&#8217;entités : les entités paramètes.<br />
Elles sont définies de la même manière sauf qu&#8217;il faut rajouter un &#8216;<em>%</em>&#8216; devant le nom :</p>
<pre>&lt;!ENTITY % nomEntity "valeur"&gt;</pre>
<p>On les utilise de la façon suivante : <em>%nomEntity;</em>.<br />
Voilà un exemple de leur utilisation :</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&gt;
&lt;!DOCTYPE articles [
  &lt;!ENTITY % article "titre, auteur, date, contenu"&gt;</pre>
<pre>  &lt;!ENTITY auteur "Marwan KHELIF"&gt;
  &lt;!ENTITY dtd "Document Type Definition"&gt;
  &lt;!ENTITY xsd "XML Schema"&gt;</pre>
<pre>  &lt;!ELEMENT articles (article*)&gt;
  &lt;!ELEMENT article (%article;)&gt;
  &lt;!ELEMENT titre (#PCDATA)&gt;
  &lt;!ELEMENT auteur (#PCDATA)&gt;
  &lt;!ELEMENT date (#PCDATA)&gt;
  &lt;!ELEMENT contenu (#PCDATA)&gt;
]&gt;</pre>
<pre>&lt;articles&gt;
  &lt;article&gt;
    &lt;titre&gt;&amp;dtd;&lt;/titre&gt;
    &lt;auteur&gt;&amp;auteur;&lt;/auteur&gt;
    &lt;date&gt;17/07/07&lt;/date&gt;
    &lt;contenu&gt;Presentation de &amp;dtd; par &amp;auteur;.&lt;/contenu&gt;
  &lt;/article&gt;
  &lt;article&gt;
    &lt;titre&gt;&amp;xsd;&lt;/titre&gt;
    &lt;auteur&gt;&amp;auteur;&lt;/auteur&gt;
    &lt;date&gt;17/07/07&lt;/date&gt;
    &lt;contenu&gt;Presentation de &amp;xsd; par &amp;auteur;.&lt;/contenu&gt;
  &lt;/article&gt;
&lt;/articles&gt;</pre>
<p>Ces deux types d&#8217;entités sont internes au document XML, on peut indiquer que la cible de l&#8217;entité est un fichier externe au document :</p>
<pre>&lt;!ENTITY doc SYSTEM "http//www.mkhelif.fr/doc.xml"&gt;
&amp;doc;
&lt;!ENTITY % articles SYSTEM "articles.dtd"&gt;
%articles;</pre>
<p>Lors de l&#8217;utilisation de l&#8217;entité le contenu du fichier sera chargé et remplacera l&#8217;entité.</p>
<h3>Pour suivre votre lecture</h3>
<ul class="related_post">
<li><a href="http://www.mkhelif.fr/2009/02/18/html-5-deux-nouveaux-documents.html" title="HTML 5 : deux nouveaux documents">HTML 5 : deux nouveaux documents</a></li>
<li><a href="http://www.mkhelif.fr/2008/03/17/nouveautes-java-7-dolphin.html" title="Nouveautés Java 7 &#8211; Dolphin">Nouveautés Java 7 &#8211; Dolphin</a></li>
</ul>
       ]]></content:encoded>
			<wfw:commentRss>http://www.mkhelif.fr/2008/01/03/validation-xml.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
