<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5097122849556671750</id><updated>2011-11-28T05:00:11.302+05:30</updated><category term='xml'/><category term='templates'/><category term='office'/><category term='java'/><category term='msoffice'/><category term='xsd'/><category term='programming'/><category term='macros'/><category term='schema'/><category term='benchmark'/><category term='word'/><category term='xml catalog'/><category term='libraries'/><category term='pdf'/><category term='threading'/><category term='c'/><category term='firefox'/><category term='acrobat'/><category term='python'/><category term='tips'/><category term='languages'/><category term='preformance'/><category term='coding'/><category term='gcc'/><category term='sax'/><category term='eclipse'/><category term='parser'/><category term='cpp'/><category term='c++'/><category term='reader'/><title type='text'>codegears</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codegears.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://codegears.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Suresh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YBslo1dMNAk/TD2Ni9cQMNI/AAAAAAAAA1Y/Gy0fSKU3PPg/S220/pic.php.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5097122849556671750.post-1717961033830659802</id><published>2008-03-22T12:29:00.001+05:30</published><updated>2008-03-22T12:31:46.001+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='xsd'/><category scheme='http://www.blogger.com/atom/ns#' term='xml catalog'/><category scheme='http://www.blogger.com/atom/ns#' term='schema'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='templates'/><title type='text'>Generating Sample XML file from Schema</title><content type='html'>&lt;p style="margin-bottom: 0in;" align="center"&gt;&lt;b&gt;Generating Sample XML files from Schema&lt;/b&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Eclipse XML Editor (comes with WTP Editor) has a nice feature to generate a sample xml file from the given schema.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Make sure you have the WTP plugin installed on your Eclipse editor – if not please check &lt;a href="http://codegears.blogspot.com/2008/03/working-with-schema-files-in-eclipse_3125.html"&gt;this&lt;/a&gt; or search in &lt;a href="http://www.google.co.in/search?hl=en&amp;amp;q=install+Eclipse+WTP+plugin&amp;amp;btnG=Google+Search&amp;amp;meta="&gt;google&lt;/a&gt;.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Let us create a sample XML file for the following Schema (this schema file is created using Eclipse Schema editor – more details can be found &lt;a href="http://codegears.blogspot.com/2008/03/working-with-schema-files-in-eclipse_3125.html"&gt;here&lt;/a&gt;.)&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" height="592" width="592"&gt;  &lt;col width="256*"&gt;  &lt;tbody style="font-family: Courier New;"&gt;&lt;tr&gt;   &lt;td bgcolor="#e6e6e6" valign="top" width="100%"&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;font size="1"&gt;&lt;font color="#008080"&gt;&amp;lt;?&lt;/font&gt;&lt;font color="#3f7f7f"&gt;xml    &lt;/font&gt;&lt;font color="#7f007f"&gt;version&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"1.0"    &lt;/font&gt;&lt;font color="#7f007f"&gt;encoding&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"UTF-8"&lt;/font&gt;&lt;font color="#008080"&gt;?&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;font size="1"&gt;&lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;schema    &lt;/font&gt;&lt;font color="#7f007f"&gt;xmlns&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"http://www.w3.org/2001/XMLSchema"    &lt;/font&gt;&lt;font color="#7f007f"&gt;targetNamespace&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"http://www.example.org/shiporder"    &lt;/font&gt;&lt;font color="#7f007f"&gt;xmlns:tns&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"http://www.example.org/shiporder"    &lt;/font&gt;&lt;font color="#7f007f"&gt;elementFormDefault&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"qualified"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;font size="1"&gt;&lt;br&gt;&lt;/font&gt;    &lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;       &lt;font size="1"&gt;&lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"shiporder"    &lt;/font&gt;&lt;font color="#7f007f"&gt;type&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"tns:shiporderType"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;           &lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;       &lt;font size="1"&gt;&lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;complexType    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"shiporderType"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt; &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;sequence&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"orderperson"    &lt;/font&gt;&lt;font color="#7f007f"&gt;type&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"string"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"shipto"    &lt;/font&gt;&lt;font color="#7f007f"&gt;type&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"tns:shiptoType"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"item"    &lt;/font&gt;&lt;font color="#7f007f"&gt;type&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"tns:itemType"    &lt;/font&gt;&lt;font color="#7f007f"&gt;maxOccurs&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"unbounded"    &lt;/font&gt;&lt;font color="#7f007f"&gt;minOccurs&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"1"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt; &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;sequence&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;       &lt;font size="1"&gt;&lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;complexType&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;font size="1"&gt;&lt;br&gt;&lt;/font&gt;    &lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;       &lt;font size="1"&gt;&lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;complexType    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"shiptoType"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt; &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;sequence&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"street"    &lt;/font&gt;&lt;font color="#7f007f"&gt;type&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"string"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"city"    &lt;/font&gt;&lt;font color="#7f007f"&gt;type&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"string"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"country"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;simpleType&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;    &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;restriction    &lt;/font&gt;&lt;font color="#7f007f"&gt;base&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"string"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;     &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;enumeration    &lt;/font&gt;&lt;font color="#7f007f"&gt;value&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"INDIA"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;enumeration&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;     &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;enumeration    &lt;/font&gt;&lt;font color="#7f007f"&gt;value&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"US"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;enumeration&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;     &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;enumeration    &lt;/font&gt;&lt;font color="#7f007f"&gt;value&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"UK"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;enumeration&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;     &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;enumeration    &lt;/font&gt;&lt;font color="#7f007f"&gt;value&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"Japan"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;enumeration&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;    &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;restriction&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;simpleType&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"pincode"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;simpleType&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;    &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;restriction    &lt;/font&gt;&lt;font color="#7f007f"&gt;base&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"int"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;     &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;pattern    &lt;/font&gt;&lt;font color="#7f007f"&gt;value&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"[0-9]{5}"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;pattern&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;    &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;restriction&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;simpleType&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt; &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;sequence&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;       &lt;font size="1"&gt;&lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;complexType&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;           &lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;       &lt;font size="1"&gt;&lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;complexType    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"itemType"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt; &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;sequence&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"title"    &lt;/font&gt;&lt;font color="#7f007f"&gt;type&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"string"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"quantity"    &lt;/font&gt;&lt;font color="#7f007f"&gt;type&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"int"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"price"    &lt;/font&gt;&lt;font color="#7f007f"&gt;type&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"double"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt; &lt;font color="#000000" size="1"&gt;       &lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;sequence&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;       &lt;font size="1"&gt;&lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;complexType&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p align="left"&gt;&lt;font size="1"&gt;&lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;schema&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;font size="1"&gt;&lt;font color="#008080"&gt;&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Assume that the above schema is stored in your project or in your system.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Now, to create a sample XML file for the above schema.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;1) Create a New XML file using File -&amp;gt; New -&amp;gt; Others... and select XML and click next.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_58dbb87zdv" name="graphics1" align="left" border="0" height="520" width="496"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;2) In the next wizard page, give the file name and the location where to create the file and click “Next”&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_59f7kx3dhn" name="graphics2" align="left" border="0" height="525" width="463"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;3) Here give select the option “Create XML file from XML Schema” (if you want to create an XML file from DTD, you can select the  first option. Click “Next” to choose the schema file.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_60hcr296cn" name="graphics3" align="left" border="0" height="536" width="476"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;4) In this wizard page, you need to give the schema file location. If your schema file is present in your workbench select the option “Select file from Workbench”. If your schema file is in your local system (but not in your workbench) you can import these files using “Import” button. However if you want to cretae an xml file from a standard schema file like WSDL or SOAP, you can choose “Select XML Catalog entry” - more on this later. Click “Next” button.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_61g2xzxvhf" name="graphics4" align="left" border="0" height="529" width="471"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;5) In this wizard you need to select the root element of you document. Let us select “shiporder” as our root element. You can check “Create optional attributes” and “Create optional elements” if you want to. However as our schema don't have any option attributes or element, you can simply ignore thos. Click “Finish” to create the XML file.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_6287tkdtqm" name="graphics5" align="left" border="0" height="516" width="458"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;6) This will create an xml file like this&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_63d5qwqhfc" name="graphics6" align="left" border="0" height="256" width="385"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;You can validate this XML file against the schema using the “Validate” option. Right click on the editor and select “Validate” option.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Observe that XML Validate found some errors in pincode tag.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_64z7xrpjfp" name="graphics7" align="left" border="0" height="78" width="773"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;It has an error saying&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;cvc-pattern-valid: Value '0' is not facet-valid with respect to &lt;b&gt;pattern '[0-9]{5}'&lt;/b&gt; for type '#AnonType_pincodeshiptoType'.&lt;/p&gt;&lt;br&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;This is because in our schema we defined the pincode to follow this pattern.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" width="100%"&gt;  &lt;col width="256*"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td bgcolor="#c0c0c0" valign="top" width="100%"&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;  &lt;font color="#000000"&gt;       &lt;font face="Monospace"&gt;&lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element    &lt;/font&gt;&lt;font color="#7f007f"&gt;name&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"pincode"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;font color="#000000"&gt;       &lt;font face="Monospace"&gt;&lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;simpleType&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;    &lt;font color="#000000"&gt;       &lt;font face="Monospace"&gt;&lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;restriction    &lt;/font&gt;&lt;font color="#7f007f"&gt;base&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"int"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;     &lt;font color="#000000"&gt;       &lt;font face="Monospace"&gt;&lt;font color="#008080"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#3f7f7f"&gt;pattern    &lt;/font&gt;&lt;font color="#7f007f"&gt;value&lt;/font&gt;&lt;font color="#000000"&gt;=&lt;/font&gt;&lt;font color="#2a00ff"&gt;"[0-9]{5}"&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;pattern&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;    &lt;font color="#000000"&gt;       &lt;font face="Monospace"&gt;&lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;restriction&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;font color="#000000"&gt;       &lt;font face="Monospace"&gt;&lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;simpleType&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p align="left"&gt;  &lt;font color="#000000"&gt;    &lt;font face="Monospace"&gt;&lt;font color="#008080"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#3f7f7f"&gt;element&lt;/font&gt;&lt;font color="#008080"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Eclipse XML editor can't generate sample data based on pattern. It simply generate “0” for intergers, “0.0” for float or double and the tag name for strings. Ofcouse many comercial ides also can't generate data based on pattern restriction.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;To fix this error manually give a valid value for pincode (a five digit value), save it and validate it again. The problem marker will go off if it is a valid value!&lt;/p&gt;&lt;br&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;b&gt;&lt;u&gt;Working with XML Catalogs&lt;/u&gt;&lt;/b&gt;&lt;br&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Now we will look at the option “Select XML Catalog entry” to create a xml instead of creating an XML file from a give schema.&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_65cpc88k5p" name="graphics8" align="left" border="0" height="663" width="619"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;If you want to create an xml file from a standand schema like WSDL, SOAP you can select this option and in the XML Catalog you can select the key.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Let us select the key “http://schemas.xmlsoap.org/wsdl” and click Next. Select “definitions” as root element and click Finish. This will generate a file that will confirm to wsdl schema.&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_66dmbfp9fj" name="graphics9" align="left" border="0" height="660" width="522"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;You can also add your custom schema to the XML Catalog entry so that whenever you want to create a XML file of that type you don't need to select the schema file again.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Now let us add our shiporder.xsd to XML Catalog.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Select Window &amp;gt; Preferences menu item. Here select Web and XML &amp;gt; XML Catalog as shown in figure.&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_67cx75bff2" name="graphics10" align="left" border="0" height="599" width="801"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Scroll down and select the “Add button” and choose either workspace or File system (wherever you schema file is present).&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_68cgfm25fg" name="graphics12" align="left" border="0" height="332" width="544"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Select the workspace option and give your schema location and click Ok.&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_69dbmj7sd4" name="graphics11" align="left" border="0" height="323" width="506"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;This will add you schema to XML Catalog&lt;/p&gt;&lt;br&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_70gftwdcdt" name="graphics13" align="left" border="0" height="572" width="682"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Click Ok to close the Preference setting dialog.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Now, you can create an XML file using this catalog entry. The first 3 three steps (till “Create XML file from Schema”) option is same. After this step Select “XML Catalog entry” and choose our shiporder.xsd and click next.&lt;/p&gt;   &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_71c4863tfk" name="graphics14" align="left" border="0" height="587" width="533"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Click Next and then Click finish. This will create our require XML file.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;The difference between the too files (one generated by directly giving the schema location) is the value of schemocation tag.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" height="25" width="559"&gt;  &lt;col width="256*"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td bgcolor="#c0c0c0" valign="top" width="100%"&gt;    &lt;p&gt;&lt;font face="Monospace"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;xsi:schemaLocation=&lt;/font&gt;&lt;font color="#800000"&gt;"http://www.example.org/shiporder    shiporder.xsd "&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" height="25" width="559"&gt;  &lt;col width="256*"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td bgcolor="#c0c0c0" valign="top" width="100%"&gt;    &lt;p&gt;&lt;font face="Monospace"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;xsi:schemaLocation=&lt;/font&gt;&lt;font color="#800000"&gt;"http://www.example.org/shiporder    http://www.example.org/shiporder&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;In the first one first one the schema file is directly referenced using relative location, so if you schema file “shiporder.xsd” is not present in the directory where the xml file recides validation won't happen propely. However for file generated from XML catalog it is refering to a web location which is not present – but validation occurs fine as it uses the catalog to search for XML Schemas before going to the web address.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Suppose if you have 50 xml files that uses a schema and now if the schema needs to be moved to someother folder you need to update the schemaLocation attribute for all the 50 xml files if you have used the first option, but if you choosen to generate XML files from XML Catalog, only you need to update the catalog by selecting Edit option in your preferences page so all your 50 xml files automatically pick the correct schema – no need to update the xml files.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;So, &lt;i&gt;cataloging&lt;/i&gt; you XML Schemas is a better way if you what to repeadly use this schema.&lt;/p&gt; &lt;br&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;b&gt;&lt;u&gt;Creating XML File from Templates&lt;/u&gt;&lt;/b&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;The New XML file wizard in Eclipse also have an option to generate XML files based on a template.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;In the “Create XML File from” page select the “Create XML file from an XML template” option.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_72rnh6j9hn" name="graphics15" align="left" border="0" height="504" width="441"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;And click next, this open up the “Select XML Template” wizard page. Now select the “Use XML Template” option and click “&lt;u&gt;&lt;font color="#0047ff"&gt;XML Tempaltes&lt;/font&gt;&lt;/u&gt;” hyperlink.&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_73fqc2j6n9" name="graphics16" align="left" border="0" height="485" width="437"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;This will open up the Preferences page&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_74djbcbq63" name="graphics17" align="left" border="0" height="577" width="753"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Click on “New...” button to create a new template.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_75fs5hdgc7" name="graphics18" align="left" border="0" height="364" width="558"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Give a name “shipOrder” and decription. Also select the Context as “New XML” so this template will be used while creating new xml files.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;In the pattern file, type (or copy and paste) the XML you want. You can also add variables to the pattern using Inset Variable... button.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Clikc OK once you are done.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Now our shipOrder will be shown in the template list as shown in  the figure (note that only templates with context New XML will be displayed here).&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;img src="http://docs.google.com/File?id=dd4kms4k_76ccjs27cj" name="graphics19" align="left" border="0" height="569" width="525"&gt;&lt;br clear="left"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Select our newly created template “shipOrder” and click finish.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;This will create an XML file using that template.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5097122849556671750-1717961033830659802?l=codegears.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codegears.blogspot.com/feeds/1717961033830659802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5097122849556671750&amp;postID=1717961033830659802' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/1717961033830659802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/1717961033830659802'/><link rel='alternate' type='text/html' href='http://codegears.blogspot.com/2008/03/generating-sample-xml-files-from-schema.html' title='Generating Sample XML file from Schema'/><author><name>Suresh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YBslo1dMNAk/TD2Ni9cQMNI/AAAAAAAAA1Y/Gy0fSKU3PPg/S220/pic.php.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5097122849556671750.post-3106904019171963009</id><published>2008-03-20T23:09:00.001+05:30</published><updated>2008-03-20T23:09:58.041+05:30</updated><title type='text'>Eclipse Schema Editor</title><content type='html'>&lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;b&gt;Working with schema files in Eclipse&lt;/b&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;A schema (XSD) is a complex language for describing the structure of your XML data. Writing or modify a schema file is quite difficult, but most the times it is required to write a new schema or understand an existing file because it the only widely used standard for describing xml structure (others are: 1) DTD, which is not used these days as it has lot of short commings including suport for namespaces 2) Relax NG). However schemas are widely used in Web services (for describing the structure of input data a service can accept – specified in wsdl types section). Check this link for more details about different languages for describing XML document &lt;a href="http://www.xml.com/pub/a/2001/12/12/schemacompare.html"&gt;http://www.xml.com/pub/a/2001/12/12/schemacompare.html&lt;/a&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;However Eclipse WTP plugin has a nice graphical Schema (XSD) editor that allows you to create, view and edit a schema file easily, effectively and without much pain in understanding the schema language.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;This presentation gives you a basic introduction and features present in schema editor.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;1) &lt;u&gt;Configuring Eclipse&lt;/u&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;If Eclipse is not readily available on your system, you can download it from &lt;a href="http://www.eclipse.org/downloads/"&gt;http://www.eclipse.org/downloads/&lt;/a&gt;, download “Eclipse IDE for J2EE development”.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-left: 0.49in; margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;u&gt;Check and Install Schema editor&lt;/u&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt; Click Help -&amp;gt; About Eclipse platform -&amp;gt; plugin details button&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt; &lt;/p&gt; &lt;div style="margin-left: 40px;"&gt;   &lt;img style="width: 755px; height: 475px;" name="graphics1" src="http://docs.google.com/File?id=dd4kms4k_31gr999gcd" align="left" border="0"&gt;&lt;br clear="left"&gt; &lt;/div&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt; Verify that there is a plugin with name “XML Schema Editor”. If Schema editor is not installed please follow the below steps to install a Schema editor.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-left: 0.49in; margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;u&gt;Installing a WTP plugin if not installed&lt;/u&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-left: 0.49in; margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;The best way to install eclipse plugins is to use “Software updates” instead of manully downloading zip file and extracting it to the eclipse folder. “Software updates” not only downloads the dependent plugins but also downloads the correct version of the plugin based on your current version of Eclipse.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-left: 0.49in; margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;Help -&amp;gt; Software updates -&amp;gt; Find and Install this open up “Install/Update” dialog. “Choose search for new features to install” option and click next, select “Web Tools platform” and click finish. This will download the latest version of WTP plugins for your Eclipse enviroment.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;2) &lt;u&gt;Creating a new schema file&lt;/u&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;Now we try to create a schema file for a shipment notice data (sample data is shown in figure). Even though there are tools that allows to generate schema from a sample xml file (available in XML Spy and Stylus studio), the idea here to familarize with Eclipse schema editor.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" height="437" width="365"&gt;   &lt;col width="256*"&gt; &lt;tbody style="font-family: Courier New;"&gt;   &lt;tr&gt;     &lt;td bgcolor="#cccccc" valign="top" width="100%"&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font color="#808080" size="2"&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;shiporder orderid=&lt;/font&gt;&lt;font color="#800000"&gt;"889923"&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;xmlns=&lt;/font&gt;&lt;font color="#800000"&gt;"urn:shiporder"&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;orderperson&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;John Smith&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/orderperson&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;shipto&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;name&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;Ola Nordmann&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/name&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;address&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;street&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;Langgt 23&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/street&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;city&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;4000 Stavanger&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/city&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;country&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;Norway&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/country&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;pincode&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;35004&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/pincode&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;/address&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;/shipto&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;item seq=&lt;/font&gt;&lt;font color="#800000"&gt;"1"&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;title&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;Empire Burlesque&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/title&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;note&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;Special Edition&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/note&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;quantity&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;1&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/quantity&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;price&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;10.90&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/price&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;/item&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;item seq=&lt;/font&gt;&lt;font color="#800000"&gt;"2"&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;title&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;Hide your heart&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/title&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;quantity&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;1&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/quantity&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;price&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;9.90&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;lt;/price&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p style="margin-bottom: 0in;" align="left"&gt;         &lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&amp;lt;/item&amp;gt;&lt;/font&gt;&lt;/font&gt;       &lt;/p&gt;       &lt;p align="left"&gt;         &lt;font color="#0000ff" size="2"&gt;&amp;lt;/shiporder&amp;gt;&lt;/font&gt;       &lt;/p&gt;     &lt;/td&gt;   &lt;/tr&gt;   &lt;/tbody&gt; &lt;/table&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;The shiporder is the root tag that has a orderid attribute and it can has detailed about name of the person who ordered the items (orderperson) and his address (address tag). It also contains the items he has order (item tag, he can order different items using same request – hence item tag can be one or more). Address contains an street, city, country and pincode. Let us assume that country is an optional tag and if it is not given the country will be US. Also the country is fixed list like US, UK, India, Japan. Pincode is five digit number. The item has an seq attribute (which is interger and a unique), title, quantity (a positive five digit integer) and price (a positive double value).&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;Now let us see how we construct a xml schema using the above constaints using Eclipse WST editor.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;I assume you don't have in depth knowledge about xml schemas (that is the reason why you and I should use an Editor – a person who wrote the schema spec can easily write schemas using notepad :-). However basic idea about schemas is required – able to identify an Element, Type (complexType or simpleType) and attributes.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;1) Create a new project, XMLSamples – using File -&amp;gt; New project and selecting “Project” under the General section&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt; &lt;/p&gt; &lt;div style="margin-left: 40px;"&gt;   &lt;img style="width: 541px; height: 509px;" name="graphics2" src="http://docs.google.com/File?id=dd4kms4k_32cjd86mgs" align="left" border="0"&gt;&lt;br clear="left"&gt; &lt;/div&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;2) Click next, and type “XMLSample” in Project name field and click Finish – This will create a new Eclipse project named “XMLSample”&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt; &lt;/p&gt; &lt;div style="margin-left: 40px;"&gt;   &lt;img style="width: 509px; height: 478px;" name="graphics3" src="http://docs.google.com/File?id=dd4kms4k_33czk38vdg" align="left" border="0"&gt;&lt;br clear="left"&gt; &lt;/div&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;3) Create a new Schema file, by using new file wizard: File -&amp;gt; New -&amp;gt; Others and selecting “XML Schema” under XML section as shown in figure.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt; &lt;/p&gt; &lt;div style="margin-left: 40px;"&gt;   &lt;img name="graphics5" src="http://docs.google.com/File?id=dd4kms4k_34ck4z7pgp" align="left" border="0" height="581" width="534"&gt;&lt;br clear="left"&gt; &lt;/div&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;4) Click next and type “shiporder.xsd” and click finish.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt; &lt;/p&gt; &lt;div style="margin-left: 40px;"&gt;   &lt;img name="graphics4" src="http://docs.google.com/File?id=dd4kms4k_34ck4z7pgp" align="left" border="0" height="585" width="529"&gt;&lt;br clear="left"&gt; &lt;/div&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;This will create a file “shiporder.xsd” in the XMLSamples project and opens in the editor. Go the design view page (if is opened in source page).&lt;/font&gt; &lt;/p&gt; &lt;br&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img style="width: 1287px; height: 979px;" name="graphics6" src="http://docs.google.com/File?id=dd4kms4k_35dw9b2pcc" align="left" border="0"&gt;&lt;br clear="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;The Eclipse schema editor has five section in the Design page&lt;/font&gt; &lt;/p&gt; &lt;ol style="font-family: Tahoma;"&gt;   &lt;li&gt;     &lt;p style="margin-bottom: 0in;" align="left"&gt;       &lt;font size="2"&gt;Directives – Other schema files that are included or improted in this schema will be listed here.&lt;/font&gt;     &lt;/p&gt;   &lt;/li&gt;   &lt;li&gt;     &lt;p style="margin-bottom: 0in;" align="left"&gt;       &lt;font size="2"&gt;Elements – All elements that the defined this schema will be shown here&lt;/font&gt;     &lt;/p&gt;   &lt;/li&gt;   &lt;li&gt;     &lt;p style="margin-bottom: 0in;" align="left"&gt;       &lt;font size="2"&gt;Types – All types that the defined in this schema will be shown here&lt;/font&gt;     &lt;/p&gt;   &lt;/li&gt;   &lt;li&gt;     &lt;p style="margin-bottom: 0in;" align="left"&gt;       &lt;font size="2"&gt;Attributes – Attributes defined will be listed in this section&lt;/font&gt;     &lt;/p&gt;   &lt;/li&gt;   &lt;li&gt;     &lt;p style="margin-bottom: 0in;" align="left"&gt;       &lt;font size="2"&gt;Groups – Goups will be listed here.&lt;/font&gt;     &lt;/p&gt;   &lt;/li&gt; &lt;/ol&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;In addition to the Design page, you need to know about Outline view and Properties view.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;If these views are not visible, you can bring them up by selecting Window -&amp;gt; Show view -&amp;gt; Others and selecting Outline view and clicking ok (same way to bring the Properties view also) – we see later how to use these views.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img name="graphics7" src="http://docs.google.com/File?id=dd4kms4k_36f7gbwkgx" align="left" border="0" height="405" width="284"&gt;&lt;br clear="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;Now, let us start adding element to our schema file.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;The root tag should be shiporder that contains orderperson, shipto and item tags. Also the schema elements should be in the namespace “urn:shiporder”&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;Right click the Element section and select Add Element menu item. Make the element names as “shiporder”.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img name="graphics9" src="http://docs.google.com/File?id=dd4kms4k_37cr9bn6pr" align="left" border="0" height="304" width="430"&gt;&lt;br clear="left"&gt;   &lt;img name="graphics8" src="http://docs.google.com/File?id=dd4kms4k_38fnjm9ngp" align="left" border="0" height="59" width="183"&gt;&lt;br clear="left"&gt;   &lt;font size="2"&gt;&lt;br style="font-family: Tahoma;"&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;You can rename the element name by click on the name text (or using Properties view).&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;By default XSD Editor creates a element of type string, but as shiporder contains others tags like ordername, so let us change the type of the shiporder.&lt;/font&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;&lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img style="width: 184px; height: 49px;" name="graphics10" src="http://docs.google.com/File?id=dd4kms4k_39g6tthkgk" align="left" border="0"&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;img name="graphics11" src="http://docs.google.com/File?id=dd4kms4k_40gqbhjmgt" align="left" border="0" height="276" width="382"&gt;&lt;br&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img name="graphics12" src="http://docs.google.com/File?id=dd4kms4k_41fsmcr6dv" align="left" border="0" height="248" width="285"&gt;&lt;br clear="left"&gt;   &lt;font size="2"&gt;&lt;br style="font-family: Tahoma;" clear="left"&gt;&lt;/font&gt;   &lt;font style="font-family: Tahoma;" face="FreeSans, sans-serif" size="2"&gt;This will open up the New type dialog, create a complex type with name “shiporderType”&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;Now double click the shiporderType item present in the Types section. Right click on the shiporderType and select “Add Element”. This will add a new element of type string. Add three element and name it as “orderperson”, “shipto” and “item” - same names as the element tags we want inside the shiporder tag.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img style="width: 180px; height: 71px;" name="graphics13" src="http://docs.google.com/File?id=dd4kms4k_42hm4jz8fv" align="left" border="0"&gt;&lt;img name="graphics14" src="http://docs.google.com/File?id=dd4kms4k_43dst4gtfq" align="left" border="0" height="150" width="253"&gt;&lt;br clear="left"&gt;   &lt;br clear="left"&gt;   &lt;font size="2"&gt;&lt;br style="font-family: Tahoma;"&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;But again our shipto and item tags are of complex type not simple type like string or int. So, right click on the shipto column and select menu item Step type -&amp;gt; New, this open up the “New type” dialog we saw previously. Name it as shiptoType. Similarly do it for item also.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img name="graphics15" src="http://docs.google.com/File?id=dd4kms4k_44rw4523c9" align="left" border="0" height="343" width="425"&gt;&lt;br clear="left"&gt;   &lt;font size="2"&gt;&lt;br style="font-family: Tahoma;"&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;The final output should look like:&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img name="graphics16" src="http://docs.google.com/File?id=dd4kms4k_45gcswnkfm" align="left" border="0" height="175" width="476"&gt;&lt;br clear="left"&gt;   &lt;font style="font-family: Tahoma;" face="FreeSans, sans-serif" size="2"&gt;Now we need to add street, city, country and pincode for shiptoType and title, quantity and price for itemType.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;You can do it by right click on the shiptoType and selecting “Add Element”&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;To change the type from string to int, you can click on the type and select int as shown in figure.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img name="graphics17" src="http://docs.google.com/File?id=dd4kms4k_46gqdjzkcq" align="left" border="0" height="395" width="407"&gt;&lt;br clear="left"&gt;   &lt;font style="font-family: Tahoma;" face="FreeSans, sans-serif" size="2"&gt;Adding all the tags the screen will look like:&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img name="graphics18" src="http://docs.google.com/File?id=dd4kms4k_47f9t4kdfz" align="left" border="0" height="264" width="566"&gt;&lt;br clear="left"&gt;   &lt;font style="font-family: Tahoma;" face="FreeSans, sans-serif" size="2"&gt;By now we have created all the require tags.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;u&gt;Adding constraints&lt;/u&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;&lt;font size="2"&gt;   “&lt;/font&gt;&lt;font size="2"&gt;item” can occur one or more time in the shiporder. To make this right click on the item and select “Set multiplicity -&amp;gt; 1...*” menu item&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img name="graphics19" src="http://docs.google.com/File?id=dd4kms4k_48d9cd2cwm" align="left" border="0" height="279" width="530"&gt;&lt;br clear="left"&gt;   &lt;font size="2"&gt;&lt;br style="font-family: Tahoma;"&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;Alternatively you can change the Min occurance and max occurance using properties view. If properties view is not visible, can make it appear by selecting the menu item “Window -&amp;gt; Show view -&amp;gt; Others” and select “Properties” in the general section..&lt;/font&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;&lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img name="graphics20" src="http://docs.google.com/File?id=dd4kms4k_49g39dvqcb" align="left" border="0" height="472" width="372"&gt;&lt;br clear="left"&gt;   &lt;font size="2"&gt;&lt;br style="font-family: Tahoma;"&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;This will open the Properties view.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;Click on each item will update the properties view to show the properties of that selected item.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;When we select the item in Design view the properties will look like:&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img style="width: 990px; height: 254px;" name="graphics21" src="http://docs.google.com/File?id=dd4kms4k_50khbq3tc6" align="left" border="0"&gt;&lt;br clear="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;You can set the minimum occurrence and maximum occurrence of the element.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;Also our pincode should be a five digit interger. To apply this contraint, click on the “pincode” and select the “constraints” tab in properties view. In the “Specify constraint values” group choose “Patterns” option and click “Add” button.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img name="graphics22" src="http://docs.google.com/File?id=dd4kms4k_51c8hgptfw" align="left" border="0" height="278" width="1000"&gt;&lt;br clear="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;This will bring up the “Regular Expression wizard”, type the regualar expression “[0-9]{5}” which specifies any letter from 0 to 9 and should occur five times. Click next to test your regualar expression and then click “Finish”.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;img name="graphics23" src="http://docs.google.com/File?id=dd4kms4k_52fp378hfh" align="left" border="0" height="527" width="531"&gt;&lt;br&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;br&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;   &lt;/p&gt;&lt;br&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;" align="left"&gt;&lt;br&gt;&lt;/p&gt;&lt;img name="graphics24" src="http://docs.google.com/File?id=dd4kms4k_53d2bt95gb" align="left" border="0" height="542" width="528"&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;font style="font-family: Tahoma;" face="FreeSans, sans-serif" size="2"&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;This will make the pincode to be an integer with only five characters (or digits).&lt;/font&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;To make the quantity a positive integer, click on the “quantity” tag and in the constraints tab of properties view, give minimum value as “0”.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;You can do the same for price also to make it a positive double.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;img name="graphics25" src="http://docs.google.com/File?id=dd4kms4k_54f5xfn5dh" align="left" border="0" height="289" width="996"&gt;&lt;br clear="left"&gt;   &lt;br&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;Finally let us make our country tag to accept only a fixed set of values like “US, UK, France, Germany, Japan and India” using the Properties view.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;To do this, click on the country item in the Design page and in the properties view select “Constraints” tab and choose “Enumerations” in the “Specific constraint values” group box. Click on Add and give a name “India”, to add one more item to the list, click “Add” button again and give “US” as value this time.&lt;/font&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;&lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;img name="graphics26" src="http://docs.google.com/File?id=dd4kms4k_55hmt8c9gg" align="left" border="0" height="328" width="1005"&gt;&lt;br clear="left"&gt;&lt;br&gt;&lt;/font&gt;    &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;Now save the file (using Ctrl + s keyboard short cut), you can view the source by click on the source tab:&lt;/font&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;&lt;font size="2"&gt;&lt;br&gt;&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;&lt;img style="width: 1011px; height: 768px;" name="graphics27" src="http://docs.google.com/File?id=dd4kms4k_56fwd7pn6k" align="left" border="0"&gt;&lt;br clear="left"&gt;&lt;br&gt;&lt;/font&gt;    &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-family: Tahoma;" align="left"&gt;   &lt;font size="2"&gt;This completes our creating schemas using XML Schema editor.&lt;/font&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;" align="left"&gt;   &lt;br&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5097122849556671750-3106904019171963009?l=codegears.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codegears.blogspot.com/feeds/3106904019171963009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5097122849556671750&amp;postID=3106904019171963009' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/3106904019171963009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/3106904019171963009'/><link rel='alternate' type='text/html' href='http://codegears.blogspot.com/2008/03/working-with-schema-files-in-eclipse_3125.html' title='Eclipse Schema Editor'/><author><name>Suresh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YBslo1dMNAk/TD2Ni9cQMNI/AAAAAAAAA1Y/Gy0fSKU3PPg/S220/pic.php.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5097122849556671750.post-5847875761609138711</id><published>2008-03-02T23:28:00.004+05:30</published><updated>2008-03-03T23:10:57.665+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='parser'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='sax'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><title type='text'>SAX Parser tips</title><content type='html'>Recently I got couple of interesting questions from my friends who are working on XML and using SAX parser to 'parse' the XML data - for performance and memory efficient;  SAX parser can work efficiently even for 2 GB XML files!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Identifying Self ending tags:&lt;br /&gt;&lt;/span&gt;Actually in XML both &amp;lt;br/&amp;gt; and &amp;lt;br/&amp;gt;&amp;lt;/br&amp;gt; are equivalent. So, using SAX parser you can't find whether it is a self ending tag or not.  However there is a work around for it - using locator objects!&lt;br /&gt;&lt;br /&gt;For &amp;lt;br/&amp;gt;, in both startElement and endElement you get the same location (getLineNumber() and getColumn number()) will be same.&lt;br /&gt;&lt;br /&gt;For &amp;lt;br/&amp;gt;&amp;lt;/br&amp;gt;, they will be different – column numbers will be different (or even line number!).&lt;br /&gt;&lt;br /&gt;But, using Locator object with SAXParser might slightly decrease the performance.&lt;br /&gt;Also one more thing, all SAX may not support Locators as this is an optional feature.&lt;br /&gt;&lt;br /&gt;More about Locators can be found at &lt;a href="http://www.saxproject.org/apidoc/org/xml/sax/Locator.html"&gt;http://www.saxproject.org/apidoc/org/xml/sax/Locator.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Handling default attributes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Problem:&lt;br /&gt;Input file : &amp;lt;xhtml:td&amp;gt;VI&amp;lt;/xhtml:td&amp;gt;Benzyl&amp;lt;/xhtml:td&amp;gt;&lt;br /&gt;&lt;br /&gt;Output file :&lt;br /&gt;&amp;lt;xhtml:td rowspan="1" colspan="1"&amp;gt;VI&amp;lt;/xhtml:td&amp;gt;&lt;br /&gt;&amp;lt;xhtml:td align="left" rowspan="1" colspan="1"&amp;gt;Benzyl&amp;lt;/xhtml:td&amp;gt;&lt;br /&gt;&lt;br /&gt;The data has "rowspan" , “colspan” automatically included in the output. But the same is not present in the input.&lt;br /&gt;&lt;br /&gt;The dtd declaration for the xhtml:td is as below&lt;br /&gt;&amp;lt;!ATTLIST %td.qname;&lt;br /&gt;  %attrs;&lt;br /&gt;  abbr        %Text;         #IMPLIED&lt;br /&gt;  axis        CDATA          #IMPLIED&lt;br /&gt;  headers     IDREFS         #IMPLIED&lt;br /&gt;  scope       %Scope;        #IMPLIED&lt;br /&gt;  xhtml:rowspan     %Number;       "1"&lt;br /&gt;  xhtml:colspan     %Number;       "1"&lt;br /&gt;  %cellhalign;&lt;br /&gt;  %cellvalign;&lt;br /&gt;  &amp;gt;&lt;br /&gt;&lt;br /&gt;These attributes are coming because they have a default value in DTD.&lt;br /&gt;&lt;br /&gt;In the DTD it is mentioned that the default value of the xhtml:rowspan is 1, so unless you specify some value the rowspan will be 1.&lt;br /&gt;&lt;br /&gt;Even if you don’t declare that attribute, SAXParser automatically get the value from the DTD (a ‘special’ feature of SAX parser called &lt;span style="font-weight: bold;"&gt;DTD defaulting&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;You can only handle this in SAX2 parser (not in SAX parser version 1.x). I think most of the SAX parser available (like one comes with JDK1.5) today are SAX2.&lt;br /&gt;&lt;br /&gt;In your startElement method, you will get an object of Attributes2 instead of Attributes; Actually Attributes2 is a subclass of Attributes.&lt;br /&gt;&lt;br /&gt;Attributes2 interface has method isSpecified() which returns true unless the attribute value was provided by DTD defaulting.&lt;br /&gt;&lt;br /&gt;So, keep this check in startElement method:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: thin solid green; background-color: #fafafa;"&gt;&lt;br /&gt;&lt;pre style="font-family: courier; font-size: 9pt"&gt;&lt;br /&gt;public void startElement (String uri, String localName, &lt;br /&gt;                          String qName, Attributes attributes) throws SAXException&lt;br /&gt;{&lt;br /&gt;  if (attributes instanceof Attributes2) {&lt;br /&gt;    Attributes2 att = (Attributes2) attributes&lt;br /&gt;      for (int i = 0; i &lt; att.getLength(); i++) {&lt;br /&gt;        if (att.isSpecified(i)) // present in xml file&lt;br /&gt;          System.out.println(att.getQName(i) + "=\"" + att.getValue(i) + "\"");&lt;br /&gt;        else {// not present in xml file, came from DTD.&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;  } // if not, we don't have a choice output all attributes.&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;There is another better way to check whether the SAX Parser Attributes2 or not - by checking the system property &lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;http://xml.org/sax/features/use-attributes2&lt;br /&gt;More details at &lt;a href="http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description"&gt;http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5097122849556671750-5847875761609138711?l=codegears.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codegears.blogspot.com/feeds/5847875761609138711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5097122849556671750&amp;postID=5847875761609138711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/5847875761609138711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/5847875761609138711'/><link rel='alternate' type='text/html' href='http://codegears.blogspot.com/2008/03/sax-parser-tips.html' title='SAX Parser tips'/><author><name>Suresh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YBslo1dMNAk/TD2Ni9cQMNI/AAAAAAAAA1Y/Gy0fSKU3PPg/S220/pic.php.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5097122849556671750.post-3345239217510894443</id><published>2008-02-17T19:23:00.006+05:30</published><updated>2008-03-04T22:42:34.781+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='word'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='office'/><category scheme='http://www.blogger.com/atom/ns#' term='msoffice'/><title type='text'>Compare two word documents using MS Word</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Compare two word documents using MS Word&lt;br /&gt;&lt;/span&gt;1.      Open a document.&lt;br /&gt;2.      On the Tools menu, click Compare and Merge Documents.&lt;br /&gt;3.      Select the document that you want to compare to the copy that is currently open.&lt;br /&gt;4.      Click the arrow next to Merge, and then do one of the following:&lt;br /&gt;       *       To display the results of the comparison in the selected document, click Merge.&lt;br /&gt;       *       To display the results in the document that is currently open, click Merge into current document.           *       To display the results in a new document, click Merge into new document.&lt;br /&gt;&lt;p&gt;The differences will be displayed as comments in the new document.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_YBslo1dMNAk/R7g8wVZxFdI/AAAAAAAAAg8/GPGlqMmbXWA/s1600-h/image003.jpg"&gt;&lt;img style="cursor: pointer;" src="http://bp0.blogger.com/_YBslo1dMNAk/R7g8wVZxFdI/AAAAAAAAAg8/GPGlqMmbXWA/s320/image003.jpg" alt="" id="BLOGGER_PHOTO_ID_5167947373484250578" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_YBslo1dMNAk/R7g8wlZxFeI/AAAAAAAAAhE/IzJkbfSG1nU/s1600-h/image004.jpg"&gt;&lt;img style="cursor: pointer;" src="http://bp1.blogger.com/_YBslo1dMNAk/R7g8wlZxFeI/AAAAAAAAAhE/IzJkbfSG1nU/s320/image004.jpg" alt="" id="BLOGGER_PHOTO_ID_5167947377779217890" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;For example here the Last updated date has been changed from 13-04-07 to&lt;br /&gt;11-05-07.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_YBslo1dMNAk/R7g8w1ZxFfI/AAAAAAAAAhM/bxVr1OH6ffs/s1600-h/image005.jpg"&gt;&lt;img style="cursor: pointer;" src="http://bp2.blogger.com/_YBslo1dMNAk/R7g8w1ZxFfI/AAAAAAAAAhM/bxVr1OH6ffs/s320/image005.jpg" alt="" id="BLOGGER_PHOTO_ID_5167947382074185202" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5097122849556671750-3345239217510894443?l=codegears.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codegears.blogspot.com/feeds/3345239217510894443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5097122849556671750&amp;postID=3345239217510894443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/3345239217510894443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/3345239217510894443'/><link rel='alternate' type='text/html' href='http://codegears.blogspot.com/2008/02/compare-two-word-documents-using-ms.html' title='Compare two word documents using MS Word'/><author><name>Suresh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YBslo1dMNAk/TD2Ni9cQMNI/AAAAAAAAA1Y/Gy0fSKU3PPg/S220/pic.php.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_YBslo1dMNAk/R7g8wVZxFdI/AAAAAAAAAg8/GPGlqMmbXWA/s72-c/image003.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5097122849556671750.post-3365890302539399551</id><published>2008-02-17T19:21:00.000+05:30</published><updated>2008-02-17T19:22:41.395+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='reader'/><category scheme='http://www.blogger.com/atom/ns#' term='pdf'/><category scheme='http://www.blogger.com/atom/ns#' term='acrobat'/><title type='text'>Speed up the start of Acrobat Reader</title><content type='html'>Opening PDF files are taking time, then&lt;br /&gt;&lt;p&gt;Method 1:&lt;br /&gt;Every time you run Adobe Acrobat, up to 20 plugins are loaded&lt;br /&gt;unnecessarily - most users do not need even a fraction of them!&lt;br /&gt;To disable unneeded plugins and make them optional instead, follow these&lt;br /&gt;instructions:&lt;br /&gt;1.      Browse to the plugins folder: C:\Program Files\Adobe\Acrobat&lt;br /&gt;7.0\Reader\plug_ins&lt;br /&gt;2.      Create a new folder named Optional&lt;br /&gt;3.      Move all files from the plug_ins folder to Optional, except&lt;br /&gt;EWH32.api, print*.api, and Search*.api&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Method 2:&lt;br /&gt;Download the software Adobe Reader SpeedUp software from&lt;br /&gt;&lt;a target="_blank" rel="nofollow" href="http://www.tnk-bootblock.co.uk/software/"&gt;http://www.tnk-bootblock.co.uk/software/&lt;/a&gt;, which does the same thing&lt;br /&gt;specified in Method 1, but in a nice GUI friendly option.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Method 3:&lt;br /&gt;Install a light weight PDF reader (other than Acrobat). The best free&lt;br /&gt;PDF reader is Foxit Reader. No need to install, just copy the executable&lt;br /&gt;and run from your system. This is very light and extremely fast.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Foxit reader is available at&lt;br /&gt;&lt;a target="_blank" rel="nofollow" href="http://us01.foxitsoftware.com/foxitreader/foxitreader.zip"&gt;http://us01.foxitsoftware.com/foxitreader/foxitreader.zip&lt;/a&gt; (just 1.8 MB&lt;br /&gt;size).&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5097122849556671750-3365890302539399551?l=codegears.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codegears.blogspot.com/feeds/3365890302539399551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5097122849556671750&amp;postID=3365890302539399551' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/3365890302539399551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/3365890302539399551'/><link rel='alternate' type='text/html' href='http://codegears.blogspot.com/2008/02/speed-up-start-of-acrobat-reader.html' title='Speed up the start of Acrobat Reader'/><author><name>Suresh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YBslo1dMNAk/TD2Ni9cQMNI/AAAAAAAAA1Y/Gy0fSKU3PPg/S220/pic.php.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5097122849556671750.post-2321813958428210356</id><published>2008-02-17T19:13:00.000+05:30</published><updated>2008-02-17T19:20:35.399+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='c'/><category scheme='http://www.blogger.com/atom/ns#' term='libraries'/><category scheme='http://www.blogger.com/atom/ns#' term='cpp'/><category scheme='http://www.blogger.com/atom/ns#' term='threading'/><title type='text'>Threading libraries in C++</title><content type='html'>Here is the list of Threading libraries in C++&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Pthread&lt;/span&gt; (POSIX threads)&lt;br /&gt;&lt;a target="_blank" rel="nofollow" href="http://en.wikipedia.org/wiki/POSIX_Threads"&gt;http://en.wikipedia.org/wiki/POSIX_Threads&lt;/a&gt;&lt;br /&gt;pthread won't work fine on windows, because windows won't support POSIX standards - but there are some implementations of pthreads api on windows also!&lt;br /&gt;Note: pthread is a c library not a c++ library, hence you can use it in c applications also.&lt;br /&gt; &lt;p&gt;&lt;span style="font-weight: bold;"&gt;Boost::thread&lt;/span&gt; - supports many compilers and architectures include Linux&lt;br /&gt;and Windows.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Check these links: &lt;a target="_blank" rel="nofollow" href="http://www.ddj.com/cpp/184401518"&gt;http://www.ddj.com/cpp/184401518&lt;/a&gt;,&lt;br /&gt;&lt;a target="_blank" rel="nofollow" href="http://www.boost.org/doc/html/thread.html"&gt;http://www.boost.org/doc/html/thread.html&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The problem with Boost libraries is that it requires good knowledge on STL, and learning is not very easy.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Glib::thread&lt;/span&gt; - Glib supports multi-threading, it can run on Windows and Linux but I don't think it supports VC++ compiler.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Check these:&lt;br /&gt;&lt;a target="_blank" rel="nofollow" href="http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/classGlib_1_1Th"&gt;http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/classGlib_1_1Th&lt;/a&gt;&lt;br /&gt;read.html, &lt;a target="_blank" rel="nofollow" href="http://inti.sourceforge.net/tutorial/libinti/threads.html"&gt;http://inti.sourceforge.net/tutorial/libinti/threads.html&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Qt:&lt;/span&gt; Qt library (not the Quick Time player from Apple) also have threading support (both 3.x and 4.x versions). Qt 4.x is released under GPL for Windows also.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a target="_blank" rel="nofollow" href="http://doc.trolltech.com/3.3/threads.html"&gt;http://doc.trolltech.com/3.3/threads.html&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Note: Nokia recently acquired TrollTech (the company behind Qt)&lt;br /&gt;&lt;/p&gt; &lt;p&gt;Intel threading library:&lt;br /&gt;One more library from Intel (open source library, GPL2 with the runtime&lt;br /&gt;exception). But only works on x86 or x86_64 (Intel or AMD; 32 or 64 bit)&lt;br /&gt;architectures.&lt;br /&gt;&lt;a target="_blank" rel="nofollow" href="http://threadingbuildingblocks.org/"&gt;http://www.intel.com/software/products/tbb/&lt;br /&gt;http://threadingbuildingblocks.org&lt;/a&gt;&lt;/p&gt;&lt;span style="font-weight: bold;"&gt;wxWidgets&lt;/span&gt; also have a threading library.&lt;br /&gt;&lt;p&gt;And it is easy to write own threading library too!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Win32&lt;/span&gt; is also having a thread api - but who is using win32 or MFC these days?&lt;br /&gt;&lt;/p&gt;However I bet on either PThreads or Boost::Threads.&lt;br /&gt;&lt;p&gt;Anyhow in next version &lt;&lt;a target="_blank" rel="nofollow" href="http://en.wikipedia.org/wiki/C%2B%2B0x"&gt;http://en.wikipedia.org/wiki/C%2B%2B0x&lt;/a&gt;&gt;  of C++, standard library will support threading - API very similar to boost::thread library! &lt;/p&gt; &lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5097122849556671750-2321813958428210356?l=codegears.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codegears.blogspot.com/feeds/2321813958428210356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5097122849556671750&amp;postID=2321813958428210356' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/2321813958428210356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/2321813958428210356'/><link rel='alternate' type='text/html' href='http://codegears.blogspot.com/2008/02/threading-libraries-in-c.html' title='Threading libraries in C++'/><author><name>Suresh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YBslo1dMNAk/TD2Ni9cQMNI/AAAAAAAAA1Y/Gy0fSKU3PPg/S220/pic.php.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5097122849556671750.post-1475841470933707855</id><published>2008-02-17T19:03:00.000+05:30</published><updated>2008-02-17T19:11:29.609+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><title type='text'>Firefox tips</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;To check Installed plugins&lt;/span&gt;&lt;br /&gt;&lt;p&gt;type: &lt;span style="font-family:courier new;"&gt;about:plugins&lt;/span&gt; in browser,&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This will show up list of plugins that are installed like Flash player&lt;br /&gt;plugin, Java plugin, Shockwave plugin.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_YBslo1dMNAk/R7g4zFZxFcI/AAAAAAAAAg0/CbrZxP_kKAw/s1600-h/Screenshot-About+Plug-ins+-+Mozilla+Firefox-1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp3.blogger.com/_YBslo1dMNAk/R7g4zFZxFcI/AAAAAAAAAg0/CbrZxP_kKAw/s320/Screenshot-About+Plug-ins+-+Mozilla+Firefox-1.png" alt="" id="BLOGGER_PHOTO_ID_5167943022682379714" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Customize the display and location of the close tab button in the tab bar&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;    You can customize the display and location of the close tab button in&lt;br /&gt;the tab bar by using about:config to edit the preference&lt;br /&gt;browser.tabs.closeButtons.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Values:&lt;br /&gt;0    Display a close button on the active tab only&lt;br /&gt;  1    (Default) Display close buttons on all tabs&lt;br /&gt;  2    Don't display any close buttons&lt;br /&gt;  3    Display a single close button at the end of the tab bar (Firefox 1.xbehavior)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Speed up Firefox&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1.Type "about:config" into the address bar and hit return. Scroll down and&lt;br /&gt;look for the following entries:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;network.http.pipelining network.http.proxy.pipelining&lt;br /&gt;network.http.pipelining.maxrequests&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Normally the browser will make one request to a web page at a time. When you&lt;br /&gt;enable pipelining it will make several at once, which really speeds up page&lt;br /&gt;loading.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. Alter the entries as follows:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Set "network.http.pipelining" to "true"&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Set "network.http.proxy.pipelining" to "true"&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Set "network.http.pipelining.maxrequests" to some number like 30. This means&lt;br /&gt;it will make 30 requests at once.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;3. Lastly right-click anywhere and select New-&gt; Integer. Name it "&lt;br /&gt;nglayout.initialpaint.delay" and set its value to "0". This value is the&lt;br /&gt;amount of time the browser waits before it acts on information it receives.&lt;br /&gt;&lt;/p&gt;If you're using a broadband connection you'll load pages MUCH faster now!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5097122849556671750-1475841470933707855?l=codegears.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codegears.blogspot.com/feeds/1475841470933707855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5097122849556671750&amp;postID=1475841470933707855' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/1475841470933707855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/1475841470933707855'/><link rel='alternate' type='text/html' href='http://codegears.blogspot.com/2008/02/firefox-tips.html' title='Firefox tips'/><author><name>Suresh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YBslo1dMNAk/TD2Ni9cQMNI/AAAAAAAAA1Y/Gy0fSKU3PPg/S220/pic.php.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_YBslo1dMNAk/R7g4zFZxFcI/AAAAAAAAAg0/CbrZxP_kKAw/s72-c/Screenshot-About+Plug-ins+-+Mozilla+Firefox-1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5097122849556671750.post-282487340752872975</id><published>2008-02-17T18:43:00.000+05:30</published><updated>2008-02-17T18:45:30.554+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='gcc'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='c'/><category scheme='http://www.blogger.com/atom/ns#' term='macros'/><category scheme='http://www.blogger.com/atom/ns#' term='coding'/><title type='text'>Working with Macros in C</title><content type='html'>&lt;p&gt;&lt;span style="font-weight: bold;"&gt;More about C Macros&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I do agree that everybody who worked in C, knows about pre-processor and macros.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;But I thought of sharing some tips about preprocessor and the gcc options to control the preprocessor output.&lt;br /&gt;&lt;br /&gt;Here is a simple usage of macros&lt;br /&gt;&lt;br /&gt;#define sum(a, b) a+b&lt;br /&gt;&lt;br /&gt;int main () {&lt;br /&gt;int k = sum(10,20)*10;&lt;br /&gt;return k;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Yes, the output is 210 (not 300, the famous interview question for freshers).&lt;br /&gt;&lt;br /&gt;Let us check the output of preprocessor and see that the result is 210...&lt;br /&gt;&lt;br /&gt;gcc takes an argument -E that output the preprocessor output.&lt;br /&gt;&lt;br /&gt;Compile the above program using gcc -E test.c -o test.txt&lt;br /&gt;Open the test.txt file and the output is&lt;br /&gt;&lt;br /&gt;int main () {&lt;br /&gt;int k = 10 +20*10;&lt;br /&gt;return k;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now you see how the #define is replaced with the value... quite useful for complex preprocessor commands.&lt;br /&gt;&lt;br /&gt;Thought of add couple of other useful preprocessor commands.&lt;br /&gt;&lt;br /&gt;For fun let us write a application that merges two XML files (by adding a root tag)... a cool application (not really, you can do it easily using a simple shell script ;-( ).&lt;br /&gt;&lt;br /&gt;Combine two or more xml files using gcc?&lt;br /&gt;Very simple.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;sample_app.x&lt;/span&gt;&lt;br /&gt;&lt;root_tag&gt;&lt;br /&gt;#include FILE1&lt;br /&gt;#include FILE2&lt;br /&gt;&lt;/root_tag&gt;&lt;br /&gt;compile it using:&lt;br /&gt;gcc -x c -P -DFILE1=\"text1.xml\" -DFILE2=\"text2.xml\" -DROOT_TAG=root1 -E sample_app.x -o result.xml&lt;br /&gt;make sure that the text1.xml and text2.xml files are available. The output will be in result.xml  (defined in -o option).&lt;br /&gt;we use the following compile options:&lt;br /&gt;-x c here our input file is sample_app.x, and gcc doesn't know whether it is C or C++ or Java, so mention that the language is c using -x option&lt;br /&gt;-P (don't generate # line directives)&lt;br /&gt;-D define the macro&lt;br /&gt;-E only preprocess, don't compile and link&lt;br /&gt;-o output file&lt;br /&gt;&lt;br /&gt;Even though the above example is very simple, there are couple of very wonderful technologies that are build using this like&lt;br /&gt;1) SQC uses this kind of logic (you too can write your own SQC compiler with some trouble).&lt;br /&gt;2) Variable-length parameter list (called varags) also uses preprocessor (if you are not sure about this, just check that printf (a c function), can take any number of arguments)... you can also create variable length argument functions.&lt;br /&gt;3) Template engines. just check the google CTemplate or Java Velocity (even though they are not written using this).&lt;br /&gt;&lt;br /&gt;Some more tools while using preprocessor.&lt;br /&gt;Predefined Macros&lt;br /&gt;__LINE__ current line number&lt;br /&gt;__FILE__&lt;br /&gt;__DATE__ current date&lt;br /&gt;__TIME__&lt;br /&gt;__cplusplus defined if using a c++ compiler&lt;br /&gt;&lt;br /&gt;Other useful macros defined by gcc&lt;br /&gt;__SIZEOF_INT__&lt;br /&gt;__SIZEOF_LONG__&lt;br /&gt;__SIZEOF_LONG_LONG__&lt;br /&gt;__SIZEOF_SHORT__&lt;br /&gt;__SIZEOF_POINTER__&lt;br /&gt;__TIMESTAMP__&lt;br /&gt;__INCLUDE_LEVEL__&lt;br /&gt;&lt;br /&gt;Stringizing using #&lt;br /&gt;Common usage of this is escaping double quotes.&lt;br /&gt;For example use what to copy a string&lt;br /&gt;Error: "File Not found" - please check " test.xml"&lt;br /&gt;We write:&lt;br /&gt;printf("Error: %s\n", "\"File Not found\" - please check \"test.xml\"");&lt;br /&gt;see the code looks ugly because of escaping double quotes, use Preprocessor to automatically include escape characters.&lt;br /&gt;&lt;br /&gt;# define Q (x) #x&lt;br /&gt;printf("Error: %s\n", Q("File Not found" - please check "test.xml")); // see we are not escaping any double quotes&lt;br /&gt;Check the result using the same gcc -E option.&lt;br /&gt;&lt;br /&gt;Token pasting using ##&lt;br /&gt;A good example in gcc document related to this.&lt;br /&gt;Say out want  to generate a commands list like:&lt;br /&gt;     struct command commands[] =&lt;br /&gt;     {&lt;br /&gt;       { "quit", quit_command },&lt;br /&gt;       { "help", help_command },&lt;br /&gt;    { "run", run_command }&lt;br /&gt;       ...&lt;br /&gt;     };&lt;br /&gt;&lt;br /&gt;where     struct command&lt;br /&gt;     {&lt;br /&gt;       char *name;&lt;br /&gt;       void (*function) (void); // hope you are aware of function pointer...&lt;br /&gt;                              &lt;/p&gt;         // I can't give you more details because I too don't much about it :-(&lt;br /&gt;     };&lt;br /&gt;    &lt;br /&gt;you can define as:&lt;br /&gt;     #define COMMAND(NAME)  { #NAME, NAME ## _command }&lt;br /&gt;    &lt;br /&gt;     struct command commands[] =&lt;br /&gt;     {&lt;br /&gt;       COMMAND (quit),&lt;br /&gt;       COMMAND (help),&lt;br /&gt;       COMMAND (run);&lt;br /&gt;       ...&lt;br /&gt;     };&lt;br /&gt;&lt;br /&gt;Just run the above example using gcc -P -E test2.c -o test2.text and see the output!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5097122849556671750-282487340752872975?l=codegears.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codegears.blogspot.com/feeds/282487340752872975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5097122849556671750&amp;postID=282487340752872975' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/282487340752872975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/282487340752872975'/><link rel='alternate' type='text/html' href='http://codegears.blogspot.com/2008/02/working-with-macros-in-c.html' title='Working with Macros in C'/><author><name>Suresh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YBslo1dMNAk/TD2Ni9cQMNI/AAAAAAAAA1Y/Gy0fSKU3PPg/S220/pic.php.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5097122849556671750.post-7444362419161216638</id><published>2007-04-21T13:34:00.001+05:30</published><updated>2008-02-17T19:03:34.431+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='preformance'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='c'/><category scheme='http://www.blogger.com/atom/ns#' term='languages'/><category scheme='http://www.blogger.com/atom/ns#' term='coding'/><category scheme='http://www.blogger.com/atom/ns#' term='benchmark'/><title type='text'>Benchmarks of different computer programming languages</title><content type='html'>Here is a bench mark of different programming languages,&lt;br /&gt;&lt;a href="http://shootout.alioth.debian.org/gp4/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"&gt; http://shootout.alioth.debian.org/gp4/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;amp;lang=java" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"&gt; http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;amp;lang=java&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For example, a comparison between c (using gcc) and Java (Sun JDK, but just note that some time IBM JDK runs faster than Sun JDK)&lt;br /&gt;&lt;a href="http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;amp;lang=" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"&gt;  http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;amp;lang=&lt;/a&gt;&lt;span style="background-color: rgb(255, 255, 51);"&gt;gcc&lt;/span&gt;&amp;amp;lang2=&lt;span style="background-color: rgb(255, 255, 51);"&gt;java&lt;/span&gt;&lt;br /&gt;C application starts 91 times much faster than Java and take 22 times less memory in recursion.&lt;br /&gt;Of course every one agrees that C is much faster than Java. But what is more important is the analysis of the results.&lt;br /&gt;For example between C and Java, except that Java takes more memory and Start up is very slow, C is just 2 times better than Java.&lt;br /&gt;Hence where memory is more and we won't start the application too often Java is better taking in to account its garbage collection and vast library. So, application servers (J2EE servers) are perfect for Java rather than Desktop application like notepad. Generally you re-start a server once in a month or so (hence start up speed of C 91 times better doesn't really matter here) and servers will have 5 GB RAM and hence whether the application takes 100 MB or 500 MB memory really is not a matter. Cool.&lt;br /&gt;&lt;br /&gt;Now lets compare Java and Python&lt;br /&gt;&lt;a href="http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;amp;lang=" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"&gt;http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;amp;lang= &lt;/a&gt;&lt;span style="background-color: rgb(255, 255, 102);"&gt; java&lt;/span&gt;&amp;amp;lang2=&lt;span style="background-color: rgb(255, 255, 51);"&gt;python&lt;/span&gt;&lt;br /&gt;Even though Python is very slow compared to Java (in some case 90 times slower in recursion), it is much better in Memory (almost in every case, it takes less memory some time 10 times) and it starts 7x better than Java. Now you got the idea, Python is better for desktop applications as it takes less memory. Desktop application memory is more important. Image Java application takes around 20 MB, then you can even run 15 Java applications on a 512 MB RAM Desktop (taking into account OS will also take some memory), but Python takes 10 times less memory so you can easily run 150 Python application simultaneously. So, we can safely conclude that Python is very hot for Desktop application (of course C is better than Python, but comparing with the huge standard library Python provides, even bigger and cleaner than Java ;- Memory usage of Python is comparable with C), it is better for Desktop applications than C or Java where memory is more important than fast (yes, imagine a Notepad written in Java than takes 20 MB of memory, 2 minutes to start and then runs as fast as C notepad. Whereas python may take around 1 or 2 MB, takes around 10 secs to load but runs slower than C Notepad. But do the user really able to differentiate a program that take 2 ms or 200 ms, here even though the other program is 100 times faster than C, it doesn't matter in this case, it matters in RDBMS or Search engines Right?).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;amp;lang=" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"&gt;http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&amp;amp;lang= &lt;/a&gt;&lt;span style="background-color: rgb(255, 255, 51);"&gt;python&lt;/span&gt; &amp;amp;lang2=&lt;span style="background-color: rgb(255, 255, 51);"&gt;perl&lt;/span&gt;&lt;br /&gt;Comparing Perl and Python, see that except in one case) both are equally good. So now we should consider only the Language, library, and portability advantages. For some fun we will compare these now.&lt;br /&gt;Python is a very clear Object oriented language, on the other hand Perl supports both OO and Structural programming. Python has a big standard library set than Perl. But developing small proto-type application in Perl is far easier than Python (in Python you need to define a class, methods). So, perl better as a scripting language or cgi programming rather than for developing large scale applications (because for large applications Perl looks cluttered and Python look very organized).&lt;br /&gt;&lt;br /&gt;So, which language is better? It depends on the type of application we are developing.&lt;br /&gt;&lt;br /&gt;Regards&lt;br /&gt;&lt;span class="sg"&gt;Suresh&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5097122849556671750-7444362419161216638?l=codegears.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codegears.blogspot.com/feeds/7444362419161216638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5097122849556671750&amp;postID=7444362419161216638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/7444362419161216638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5097122849556671750/posts/default/7444362419161216638'/><link rel='alternate' type='text/html' href='http://codegears.blogspot.com/2007/04/fwd-check-this-site.html' title='Benchmarks of different computer programming languages'/><author><name>Suresh</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/_YBslo1dMNAk/TD2Ni9cQMNI/AAAAAAAAA1Y/Gy0fSKU3PPg/S220/pic.php.jpg'/></author><thr:total>0</thr:total></entry></feed>
