<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="common.xsl"?>
<tutorial>
	<html>
	<head>
	<title/>
	<body>	
	<category name="XML Tutorials">
    <group name="All about XML Tech"><description><![CDATA[<p>This section will cover the following topics:
		<ul><li>What is a Markup Language</li>
	  		<li>What is XML?</li>
  			<li>XML versus HTML?</li>
		  	<li>History of XML</li>
	  		<li>Advantages of XML</li>
  			<li>Disadvantages of XML</li></ul>
		]]></description>
	<sub-tree1 name="What is a Markup Language?"><description><![CDATA[Surely, if you have decided to learn about XML, you are probably already quite familiar with the concepts 
        behind HTML (HyperText Markup Language). So let's start from there.<p>HTML, as its name implies, 
        is a markup language. As such, it is used to markup text. But what exactly 
        does it mean to markup text? Marking up text is a methodology for encoding 
        data with information about itself. For example, when you read the textbook, 
        you often use yellow highlighter pen to highlight the sentences in the 
        textbook. By highlighting certain bits of text, you were effectively &quot;marking-up&quot; 
        the data. Essentially, you specified that certain sentences (data) were 
        important by marking them in yellow. These sentences became encoded with 
        the fact that they were important.
      	<p>And what's more, since everyone followed the same standard of marking up, you could easily pick up a used 
        textbook and get a good idea just from reading the highlighted sections what were core points of the book.
      	<p>So, It is possible to classify markup as one of the three types: stylistic, structural or semantic.
      	<h4>Stylistic Markup</h4>This indicates how the document is to be presented. In HTML, stylistic markup could be &lt;FONT&gt;, &lt;I&gt;, &lt;B&gt; and &lt;U&gt; tags.
		<h4>Structural Markup</h4>This informs us of how the document is to be structured. In HTML, structural markup could be &lt;P&gt; 
        and &lt;DIV&gt; tags to indicate a paragraph and container section respectively.
		<h4>Semantic Markup</h4>This tells us something about the content of the data. In HTML, semantic markup could be &lt;TITLE&gt; 
        tag.<p>By now, you should have a clear idea about what is a mark up language - right! So, let's move on!!!
	]]></description>
    </sub-tree1>
	<sub-tree1 name="What is XML?"><description><![CDATA[<p>Like HTML, XML (also known 
        as Extensible Markup Language) is a markup language which relies on the 
        concept of rule-specifying tags and the use of a tag-processing application 
        that knows how to deal with the tags.
      	<p>However, XML is far morepowerful than HTML. The secret is because of the X. XML is &quot;eXtensible&quot;. 
        Specifically, rather than providing a set of pre-defined tags, as in the 
        case of HTML, XML specifies the standards with which you can define your 
        own markup languages with their own sets of tags. XML is a meta-markup 
        language which allows you to define an infinite number of markup languages 
        based upon the standards defined by XML.
      	<p>In HTML, web authors often use tables to present their product information such as:<br><br>
        <font size="1"><b>product.html</b></font>
      	<table border="0" cellpadding="0" cellspacing="0" width="42%">
        	<tr><td width="100%" colspan="3"><font color="black" size="1">&lt;TABLE BORDER=1&gt;</font></td></tr>
        	<tr><td width="8%"></td><td width="92%" colspan="2"><font color="black" size="1">&lt;TR&gt;</font></td></tr>
        	<tr><td width="8%"></td><td width="8%"></td><td width="84%"><font color="black" size="1">&lt;TH&gt;Product ID&lt;/TH&gt;</font></td></tr>
        	<tr><td width="8%"></td><td width="8%"></td><td width="84%"><font color="black" size="1">&lt;TH&gt;Description&lt;/TH&gt;</font></td></tr>
        	<tr><td width="8%"></td><td width="8%"></td><td width="84%"><font color="black" size="1">&lt;TH&gt;Price&lt;/TH&gt;</font></td></tr>
        	<tr> <td width="8%"></td><td width="92%" colspan="2"><font color="black" size="1">&lt;/TR&gt;</font></td></tr>
        	<tr><td width="8%"></td><td width="92%" colspan="2"><font color="black" size="1">&lt;TR&gt;</font></td></tr>
        	<tr><td width="8%"></td><td width="8%"></td><td width="84%"><font color="black" size="1">&lt;TD&gt;656565&lt;/TD&gt;</font></td> </tr>
        	<tr><td width="8%"></td><td width="8%"></td><td width="84%"><font color="black" size="1">&lt;TD&gt;Pentium III&lt;/TD&gt;</font></td></tr>
        	<tr><td width="8%"></td><td width="8%"></td><td width="84%"><font color="black" size="1">&lt;TD&gt;$1999.99&gt;/TD&gt;</font></td></tr>
        	<tr><td width="8%"></td><td width="92%" colspan="2"><font color="black" size="1">&lt;/TR&gt;</font></td></tr>
        	<tr><td width="100%" colspan="3"><font color="black" size="1">&lt;/TABLE&gt;</font></td></tr>
      	</table><p>Your HTML browser renders the example above like so:<br><br>        
      	<TABLE BORDER=1 width="285">
        	<TR> 
          		<TH width="87"><font color="#000000" size="1">Product ID</font></TH>
          		<TH width="94"><font color="#000000" size="1">Description</font></TH>
          		<TH width="82"><font color="#000000" size="1">Price</font></TH></TR>
        	<TR> 
          		<TD width="87"><font color="#000000" size="1">656565</font></TD>
          		<TD width="94"><font color="#000000" size="1">Pentium III</font></TD>
          		<TD width="82"><font color="#000000" size="1">$1999.99</font></TD></TR>
      	</TABLE><p>XML uses markup tags as well, but unlike HTML, XML tags describe the content, rather than the 
        presentation of that content. So, in the example above instead of using 
        &lt;TABLE&gt;, we would define our own tag called &lt;product&gt;. Thus, 
        the same example above could be coded in XML as:</p>
      	<table border="0" cellpadding="0" cellspacing="0" width="76%">
        	<tr><td width="100%" colspan="2"><font color="black" size="1"><b>product.xml</b></font></td></tr>
        	<tr><td width="100%" colspan="2"><font color="black" size="1">&lt;product&gt;</font></td></tr>
        	<tr><td width="8%"></td><td width="92%"><font color="black" size="1">&lt;id&gt;656565&lt;/id&gt;</font></td></tr>
        	<tr><td width="8%"></td><td width="92%"><font color="black" size="1">&lt;description&gt;Pentium III&lt;/description&gt;</font></td></tr>
        	<tr><td width="8%"></td><td width="92%"><font color="black" size="1">&lt;price&gt;$1999.99&lt;/price&gt;</font></td></tr>
        	<tr><td width="100%" colspan="2"><font color="black" size="1">&lt;/product&gt;</font></td></tr>
      	</table><p>Ironically, by avoiding formatting tags in the data, but marking the meaning of the 
        data itself with &lt;product&gt;, we actually make it easier for a client 
        to search various individual servers for a product and receive a product 
        list tailored to the preferences of the user.</p>
	]]></description>
	</sub-tree1>
	<sub-tree1 name="XML vs HTML?"><description><![CDATA[<li>XML is not a replacement for HTML.</li><li>XML was 
              designed to describe data and to focus on what data is.&nbsp; On the other hand, HTML was designed to display data and to focus on how data looks.</li></blockquote><p> 
      	<h4>XML is about data</h4>
		<p>HTML is about displaying information, whereas XML is about describing information (as shown in the example above).</p></blockquote>
      	<h4>XML is extensible</h4>
      	<blockquote><p>XML allows the author to define his own tags and his own document structure. Whereas, 
          	in HTML, the HTML authors must use a pre-defined tags and structure that HTML has provided.</p></blockquote>
      	<h4>XML is a complement to HTML</h4>
      	<blockquote><p>It is important to understand that XML is not a replacement for HTML. In the future development of 
          the Web, it is most likely that XML will be used to structure and describe 
          the Web data, while HTML will be used to format and display the same data.</p></blockquote>    
	]]></description>
	</sub-tree1>
	<sub-tree1 name="History of XML"><description><![CDATA[<p>XML emerged as a way to 
        overcome the shortcomings of its two predecessors, SGML and HTML which 
        were both very successful markup languages, but which were both flawed 
        in certain ways.
      	<p>SGML, the international standard for marking up data, has been used since the 80s. SGML is an 
        extremely powerful and extensible tool for semantic markup which is particularly 
        useful for cataloging and indexing data. However, SGML is pretty darn 
        complex, especially for the everyday uses of the web. Not only that, SGML 
        is pretty expensive as well. Thus, the commercial browsers made it pretty 
        clear that they did not intend to ever support SGML.
      	<p>HTML on the other hand was free, simple and widely supported. HTML was originally designed at CERN 
        around 1990 to provide a very simple version of SGML which could be used 
        by regular people. As everyone knows, HTML spreads like wildfire. Unfortunately, 
        HTML has serious defects as follow: 
      	<ol style="color: black"><li>The GUI is embedded in the data which make it hard to modify the content. 
        <li>Searching for information in the data is tough.<li>The data is tied to the logic and language of HTML.</li></ol>
      	<p>So in 1996, discussions began which focused on how to define a markup language with the power 
        and extensibility of SGML but with the simplicity of HTML. The World Wide 
        Web Consortium (W3C) decided to sponsor a group of SGML gurus including Jon Bosak from Sun.
      	<p>Essentially, Bosak and his team did to SGML what the Java team had done to C++. All of the non-essential, 
        unused, cryptic parts of SGML were sliced away. What remained was a clean, mean marking up machine: that is XML.&nbsp;  
      	<p> The specification of XML (written mostly by Tim Bray and C.M. Sperberg-McQueen) was only 26 pages 
        as opposed to the 500+ pages of the SGML specification! Nevertheless, 
        all the useful things which could be done by SGML, could also be done with XML.
      	<p>Over the next few years, XML evolved, drawing from the work of its sponsors and the work of developers 
        solving similar problems such as Peter Murray-Rust who had been working 
        on CML (Chemical Markup Language) and the consortium of folks working 
        on MML or MathML (Mathematic Markup Language). By mid 1997 the XLL (eXtensible 
        Linking Language) project was underway and by the summer of 1997, Microsoft 
        had launched the CDF (Channel Definition Format)&nbsp; as one of the first real-world applications of XML. 
      	<p>Finally, in 1998, the W3C approved Version 1.0 of the XML specification and a new language was born.</p>     
	]]></description>
	</sub-tree1>
	<sub-tree1 name="Advantages of XML"><description><![CDATA[<p>Because you are writing 
        your own markup language. Thus, you are not restricted to a limited set 
        of tags defined by proprietary vendors. With XML, you can create your own set of tags at your own pace. 
      	<p>Of course, not only are you free to develop at your own pace, but you are also free to develop 
        tools that meet your needs exactly. 
      	<p>By defining your own tags, you create the markup language in terms of your specific problem set! 
        Rather than relying on a generic set of tags which suits everyone's needs 
        adequately, XML allows every person or organization to build their own 
        tag library which suits their needs perfectly.</p>
      	<p>XML allows each specific industry to develop its own tag sets to meet its unique needs without 
        forcing everyone's browser to incorporate the functionality of zillions 
        of tag sets, and without forcing the developers to settle for a generic 
        tag set that is too generic to be useful.</p>
      	<p>The real power of XML comes from the fact that with XML, not only can you define your own set of tags, 
        but the rules specified by those tags need not be limited to formatting 
        rules. XML allows you to define all sorts of tags with all sorts of rules, 
        such as tags representing business rules or tags representing data description 
        or data relationships. 
      	<ol style="color: black">
			<li>With XML, the GUI is extracted. Thus, changes to display do not require futzing with the 
	         	data. Instead, a separate style sheet will specify a table display ora list display. 
        	<li>Searching the data is easy and efficient. Search engines can simply parse the description-bearing 
          		tags rather than muddling in the data. Tags provide the search engines with the intelligence they lack.
        	<li>Complex relationships like trees and inheritance can be communicated.
        	<li>The code is much more legible to a person coming into the environment with no prior knowledge.</li></ol>     
	]]></description>
	</sub-tree1>

	<sub-tree1 name="Disadvantages of XML"><description><![CDATA[<p>The lack of adequate processing 
        applications. There are no XML browsers on the market yet (although the 
        latest version of IE does a pretty good job of incorporating XSL and XML 
        documents provided HTML is the output). Thus, XML documents must either 
        be converted into HTML before distribution or converting it to HTML on-the-fly 
        by middleware. Barring translation, developers must code their own processing applications.
      	<p>The most common tactic used now is to write parsing routines in DHTML or Java, or Server-Side PERL 
        to parse through an XML document, apply the formatting rules specified 
        by the style sheet, and convert it all to HTML.</p>     
	]]></description>
	</sub-tree1> 
    </group>		
    <group name="How XML can be used"><description><![CDATA[<h4>XML can keep data separated from your HTML.</h4>
      	<blockquote><p>HTML pages are used to display data. Data is often stored inside HTML pages. With XML this 
          data can now be stored in a separate XML file. This way you can concentrate 
          on using HTML for formatting and display, and be sure that changes in 
          the underlying data will not force changes to any of your HTML code.</p></blockquote>
      	<h4>XML can be used to store data inside HTML documents.</h4>
      	<blockquote> 
        <p>XML data can also be stored inside HTML pages as Data Islands. You can still concentrate on using HTML for formatting and displaying the data.</p></blockquote>
      	<h4>XML can be used as a format to exchange information.</h4>
      	<blockquote> 
        <p>In the real world, computer systems and databases contain data in incompatible formats. One of the 
          most time consuming challenges for developers has been to exchange data 
          between such systems over the Internet. Converting the data to XML can 
          greatly reduce this complexity and create data that can be read by different types of applications.</p> </blockquote>
      	<h4>XML can be used to store data in files or in the databases.</h4>
      	<blockquote><p>Applications can be written to store and retrieve information from the store, and generic applications can be used to display the data.</p></blockquote>
	]]></description>
	<sub-tree1 name="XML Example"><description><![CDATA[
		<table border="0" width="323" cellspacing="0" cellpadding="0">
        	<tr><td width="321" colspan="2"><font color="black" size="1">&lt;?xml version=&quot;1.0&quot;?&gt;</font></td></tr>
        	<tr><td colspan="2" width="321"><font color="black" size="1">&lt;note&gt;</font></td></tr>
        	<tr><td width="24"></td><td width="295"><font color="black" size="1">&lt;to&gt;Tove&lt;/to&gt;</font></td></tr>
        	<tr><td width="24"></td><td width="295"><font color="black" size="1">&lt;from&gt;Jani&lt;/from&gt;</font></td></tr>
        	<tr><td width="24"></td><td width="295"><font color="black" size="1">&lt;heading&gt;Reminder&lt;/heading&gt;</font></td></tr>
        	<tr><td width="24"></td><td width="295"><font color="black" size="1">&lt;body&gt;Don't forget me this weekend!!!&lt;/body&gt;</font></td></tr>
        	<tr><td colspan="2" width="321"><font color="black" size="1">&lt;/note&gt;<br><br></font></td></tr>
      	</table>    
      	<table border="1" width="99%" cellspacing="0" cellpadding="0">
        	<tr><td width="55%" valign="top"><font color="black"><b>Line-by-line code</b></font></td><td width="45%"><font color="black"><b>Explanation</b></font></td></tr>
        	<tr><td width="55%" valign="top"><font color="black" size="1">&lt;?xml version=&quot;1.0&quot;?&gt;</font></td><td width="45%"><font color="black" size="1">The XML declaration should always be included. It defines the XML version 
            	of the document. In this case, the document conforms to the 1.0 specification of XML.</font></td></tr>
        	<tr><td width="55%" valign="top"><font color="black" size="1">&lt;note&gt;</font></td>
          		<td width="45%"><font color="black" size="1">Defines the first element (the root element) of the document.</font></td></tr>
        	<tr><td width="55%"><font color="black" size="1">&lt;to&gt;Tove&lt;/to&gt;<br>
            	&lt;from&gt;Jani&lt;/from&gt;<br>
            	&lt;heading&gt;Reminder&lt;/heading&gt;<br>
            	&lt;body&gt;Don't forget me this weekend!!!&lt;/body&gt;</font></td>
          		<td width="45%" valign="top"><font color="black" size="1">Defines 4 elements of the root (to, from, heading and body).</font></td></tr>
        	<tr><td width="55%"><font color="black" size="1">&lt;/note&gt;</font></td>
          		<td width="45%"><font color="black" size="1">The last line defines the end of the root element.</font></td></tr>
      	</table>
	]]></description>
	</sub-tree1>
		<sub-tree1 name="What's an XML doc looks like"><description><![CDATA[<p>Let's save a piece 
        of code above as note.xml (by the way, XML document should have .xml as 
        it's extension) and open it in the IE. Below is what you actually see 
        on the browser.</p><p><img border="0" src="grafix/note.gif" width="379" height="133"></p>
		]]></description>
	</sub-tree1>
    </group>
    <group name="XML Syntax - General Idea"><description><![CDATA[<h4>1. All XML elements must have a closing tag</h4>
      	<br>In HTML some elements do not have to have a closing tag. The following code is legal in HTML:
      	<table border="0" cellpadding="0" cellspacing="0" width="99%">
        	<tr><td width="5%"></td><td width="95%"><font color="black" size="1">&lt;p&gt;This is a paragraph</font></td></tr>
        	<tr><td width="5%"></td><td width="95%"><font color="black" size="1">&lt;p&gt;This is another paragraph</font></td></tr>
      	</table><br>In XML all elements must have a closing tag like this:
      	<table width="98%" border="0" cellspacing="0" cellpadding="0">
        	<tr><td width="5%"></td><td width="95%"><font color="black" size="1">&lt;p&gt;This is a paragraph&lt;/p&gt;</font></td></tr><tr> 
          		<td width="5%" height="20">&nbsp;</td><td width="95%" height="20"><font color="black" size="1">&lt;p&gt;This is another paragraph&lt;/p&gt;</font></td></tr>
      	</table>
      	<h4>2. XML tags are case sensitive</h4>
      	<p>XML tags are case sensitive. Opening and closing tags must therefore be written with the same case.</p>
      	<table width="98%" border="0" cellspacing="0" cellpadding="0">
        	<tr><td width="4%"><img border="0" src="grafix/warn.gif" width="27" height="20"></td>
          		<td width="96%"><font color="black" size="1">&lt;Message&gt;This is incorrect&lt;/message&gt;</font></td></tr>
        	<tr><td width="4%">&nbsp;</td><td width="96%"><font color="black" size="1">&lt;message&gt;This is correct&lt;/message&gt;</font></td></tr>
      	</table>
      	<br><b>Important</b>: Tags should begin with either a letter, an underscore (_) or a colon (:) 
        followed by some combination of letters, numbers, periods (.), colons, 
        underscores, or hyphens (-) but no white space, with the exception that 
        no tags should begin with any form of &quot;xml&quot;. It is also a good 
        idea to not use colons as the first character in a tag name even if it 
        is legal. Using a colon first could be confusing. Here are some legal 
        and illegal tags examples:
      	<table border="1" cellpadding="0" cellspacing="0" width="99%" bordercolor="#CCCCFF">
        	<tr><td width="44%"><font color="black" size="1"><b>Legal tags</b></font></td><td width="56%"><font color="black" size="1"><b>Illegal tags</b></font></td></tr>
        	<tr><td width="44%"><font color="black" size="1">&lt;first-name&gt;</font></td>
          		<td width="56%"><font color="black" size="1">&lt;first - name&gt;</font></td></tr>
        	<tr><td width="44%"><font color="black" size="1">&lt;last.name&gt;</font></td>
          		<td width="56%"><font color="black" size="1">&lt;last . name&gt;</font></td></tr>
        	<tr><td width="44%"><font color="black" size="1">&lt;namexml&gt;</font></td>
          		<td width="56%"><font color="black" size="1">&lt;xmlname&gt;</font></td></tr>
      	</table>
      	<h4>3. All XML elements must be properly nested</h4>
      	<br>In HTML some elements can be improperly nested within each other like this:
      	<table width="98%" border="0" cellspacing="0" cellpadding="0">
        	<tr><td width="5%">&nbsp;</td><td width="95%"><font color="black" size="1">&lt;b&gt;&lt;i&gt;This text is bold and italic&lt;/b&gt;&lt;/i&gt;</font></td></tr>
      	</table>
      	<br>In XML, all elements must be properly nested within each other like this:
      	<table width="98%" border="0" cellspacing="0" cellpadding="0">
        	<tr><td width="5%">&nbsp;</td><td width="95%"><font color="black" size="1">&lt;b&gt;&lt;i&gt;This text is bold and italic&lt;/i&gt;&lt;/b&gt;</font></td></tr>
      	</table>
      	<h4>4. All XML documents must have a root tag</h4>
      	<br>All XML documents must contain a single tag pair to define the root element. All other elements must 
        be nested within the root element. All elements can have sub (children) 
        elements. Sub elements must be in pairs and correctly nested within their parent element. eg.
      	<table border="0" width="319" cellspacing="0" cellpadding="0">
        	<tr><td colspan="3" width="317"><font color="black" size="1">&lt;root&gt;</font></td></tr>
        	<tr><td width="17"></td><td colspan="2" width="298"><font color="black" size="1">&lt;child&gt;</font></td></tr>
        	<tr><td width="17"></td><td width="24"></td><td width="272"><font color="black" size="1">&lt;subchild&gt;</font></td></tr>
        	<tr><td width="17"></td><td width="24"></td><td width="272"><font color="black" size="1">&lt;/subchild&gt;</font></td></tr>
        	<tr><td width="17"></td><td colspan="2" width="298"><font color="black" size="1">&lt;/child&gt;</font></td></tr>
        	<tr><td colspan="3" width="317"><font color="black" size="1">&lt;/root&gt;</font></td></tr>
      	</table>
      	<h4>5. Attribute values must always be quoted</h4>
      	<p>XML elements can have attributes in name/value pairs just like in HTML. In XML the attribute value must always be quoted. eg.</p>  
      	<table border="1" width="99%" cellpadding="0" cellspacing="0">
        	<tr><td width="46%"><font color="black" size="1"><b>Correct</b></font></td><td width="54%"><font color="black" size="1"><b>Incorrect</b></font></td></tr>
        	<tr><td width="46%"><font color="black" size="1">&lt;?xml version=&quot;1.0&quot;?&gt;</font></td><td width="54%"><font color="black" size="1">&lt;?xml version=&quot;1.0&quot;?&gt;</font></td></tr>
        	<tr><td width="46%"><font color="black" size="1">&lt;note date=&quot;25/06/00&quot;&gt;</font></td><td width="54%"><font color="black" size="1">&lt;note date=25/06/00&gt;</font></td></tr>
      	</table>
      	<h4>Avoid using attributes?</h4>
      	<br>Attributes are handy in HTML. But in XML you should try to avoid them (you could easily substitute 
        attributes by elements - I will show you later so you could get the idea!!!). 
        Why? Below are some of the problems using attributes.
      	<li>Attributescan not contain multiple values</li>
		<li>Attribute are not expandable</li>
		<li>Attribute are more difficult to manipulate by program code</li>
		<li>Attribute values are not easy to test against DTD</li>
      	<p>Let me clear up your doubt by looking at the following example:</p><p><b>An XML example</b></p>
      	<table border="0" cellpadding="0" cellspacing="0" width="319">
        	<tr><td colspan="2" width="317"><font color="black" size="1">&lt;?xml version=&quot;1.0&quot;?&gt;</font></td></tr>
        	<tr><td colspan="2" width="317"><font color="black" size="1">&lt;note&gt;</font></td></tr>
        	<tr><td width="22"></td><td width="293"><font color="black" size="1">&lt;date&gt;12/11/00&lt;/date&gt;</font></td></tr>
        	<tr><td width="22"></td><td width="293"><font color="black" size="1">&lt;to&gt;Tove&lt;/to&gt;</font></td></tr>
        	<tr><td width="22"></td><td width="293"><font color="black" size="1">&lt;from&gt;Jani&lt;/from&gt;></font></td></tr>
        	<tr><td width="22"></td><td width="293"><font color="black" size="1">&lt;subject&gt;Reminder&lt;/subject&gt;</font></td></tr>
        	<tr><td width="22"></td><td width="293"><font color="black" size="1">&lt;body&gt;Don't forget me this weekend&lt;/body&gt;</font></td></tr>
        	<tr><td colspan="2" width="317"><font color="black" size="1">&lt;/note&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></td></tr>
      	</table>
      	<br>If you look at the element &lt;date&gt; above, how do you interpret it??? Is this 12. of November 
        or 11. of December??? <br>Now, let see how you can expand the &lt;date&gt; element:<br>    
      	<table border="0" cellpadding="0" cellspacing="0" width="323">
        	<tr><td width="321" colspan="3"><font color="black" size="1">&lt;?xml version=&quot;1.0&quot;?&gt;</font></td></tr>
        	<tr><td width="321" colspan="3"><font color="black" size="1">&lt;note&gt;</font></td></tr>
        	<tr><td width="22"></td><td width="297" colspan="2"><font color="black" size="1">&lt;date&gt;</font></td></tr>
       	 	<tr><td width="22"></td><td width="24"></td><td width="271"><font color="black" size="1">&lt;date&gt;12&lt;/date&gt;</font></td></tr>
        	<tr><td width="22"></td><td width="24"></td><td width="271"><font color="black" size="1">&lt;month&gt;11&lt;/month&gt;</font></td></tr>
        	<tr><td width="22"></td><td width="24"></td><td width="271"><font color="black" size="1">&lt;year&gt;99&lt;/year&gt;</font></td></tr>
        	<tr><td width="22"></td><td width="297" colspan="2"><font color="black" size="1">&lt;/date&gt;</font></td></tr>
        	<tr><td width="22"></td><td width="297" colspan="2"><font color="black" size="1">&lt;to&gt;Tove&lt;/to&gt;</font></td></tr>
        	<tr><td width="22"></td><td width="297" colspan="2"><font color="black" size="1">&lt;from&gt;Jani&lt;/from&gt;</font></td></tr>
        	<tr><td width="22"></td><td width="297" colspan="2"><font color="black" size="1">&lt;heading&gt;Reminder&lt;/heading&gt;</font></td></tr>
        	<tr><td width="22"></td><td width="297" colspan="2"><font color="black" size="1">&lt;body&gt;Don't forget me this weekend&lt;/body&gt;</font></td></tr>
        	<tr><td width="321" colspan="3"><font color="black" size="1">&lt;/note&gt;</font></td></tr>
      	</table><p>&nbsp;Got the idea???</p> 
	]]></description>
	<sub-tree1 name="XML Well-formed"><description><![CDATA[<p>If you have read the XML 
        Syntax - General Idea section above, by now you should have a very fair 
        idea about XML in general. So, I am going to move on to more interesting 
        topic that is XML well-formed. XML Documents consider well formed should satisfy three simple rules:</p>
      	<ol><li>The document must contain one or more elements.</li><li>It must contain a uniquely name element, no part of which appears in the content of any other element, 
          	known as the root element.</li><li>All other elements within the root element must be correctly nested.</li></ol>
      	<p>So, according to these rules, the following are examples of well formed documents:</p>
      	<blockquote><font size="1"><p><b>example1.xml</b><br>&lt;empty_tag&gt;&lt;/empty_tag&gt;</p></blockquote>
      	<blockquote><p><b>example2.xml</b><br>&lt;?xml version=&quot;1.0&quot;?&gt;<br>&lt;class&gt;Mammalia&lt;/class&gt;</p>
        	<p><b>example3.xml</b><br>&lt;root&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;class&gt;Mammalia&lt;/class&gt;<br>
          	&lt;/root&gt;</p><p><b>example4.xml</b><br>&lt;empty_tag/&gt;</p></font></blockquote>
      	<p>Note: example1.xml and example4.xml are the same.</p>
      	<p><img border="0" src="grafix/warn.gif" width="27" height="20">The following is example of not well formed documents:</p>
      	<blockquote><font size="1"><p>bad_example.xml<br>
          	&lt;bad_parent&gt;<br>
          	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;naughty_child&gt;Some text info<br>
          	&lt;/bad_parent&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/naughty_child&gt;</p></blockquote></font>
      	<p><b>Explanation:</b> If you look carefully, you can see that the element &lt;naughty_child&gt; overshoots 
        the end of the &lt;bad_parent&gt; element, which should encapsulate the 
        &lt;naughty_child&gt; element completely (According to rule 3 above).</p>
	]]></description>
	</sub-tree1>
	<sub-tree1 name="XML doc structure"><description><![CDATA[<p>Physically, documents are 
        composed of a set of entities (we will talk about this topic in a bit) 
        that are identified by unique names. All documents begin with a root or 
        document entity. All other entities are optional.</p>
      	<p>As opposed to physical structure, XML documents have a logical structure as well. Logically, documents are 
        composed of declarations, elements, comments, character references and 
        processing instructions, all of which are indicated in the document by explicit markup.</p>  
	]]></description>
	</sub-tree1>
	<sub-tree1 name="Data vs Markup"><description><![CDATA[<p>All XML documents may be 
        understood in terms of the data they contain and the markup that describe that data.&nbsp;</p>
      	<p>Data is typically &quot;character data&quot; (i.e. anything within the boundaries of valid Unicode such 
        as letters, numbers, punctuation and so on) but can also be binary data as well.</p>
      	<p>Markup includes tags, comments, processing instructions, DTDs and references and so forth.&nbsp;</p>
      	<p><font size="1">For example: &lt;name&gt;John Smith&lt;/name&gt;<font></p>
      	<p><b>Explanation</b>: &lt;name&gt;and &lt;/name&gt; tags comprise the markup and &quot;John Smith&quot; comprises the character data.</p> 
	]]></description>
	</sub-tree1>
	<sub-tree1 name="XML Declaration"><description><![CDATA[<p>To begin an XML document, 
        it is a good idea to include the XML declaration at the very first line 
        of the document. Though the XML declaration is optional, but the W3C specification 
        (World Wide Web Consortium - the group developed XML)&nbsp; suggests that 
        we should include it to indicate the version of XML, used to construct 
        the document so that an appropriate parser or parsing process can be matched 
        to the document.&nbsp;</p>
      	<p>Essentially, the XML declaration is a processing instruction that notifies the processing agent (browser) 
        that the following document has been marked up as an XML document. It will look something like the following:<br></p>
      	<div align="justify">
        <table border="1" cellpadding="0" width="99%"">
          	<tr><td width="100%"><font color="black" size="1">&lt;?xml version=&quot;1.0&quot;?&gt;&nbsp;</font></td></tr>
        </table></div>
      	<p> OR&nbsp;having a white space in between as shown below.<br></p>
      	<div align="justify">
        <table border="1" cellpadding="0" width="99%">
          	<tr><td width="100%"><font color="black" size="1">&lt;?xml version = &quot;1.0&quot; ?&gt;</font></td></tr>
        </table>
      	</div><p>We will talk more about the gory details of processing instructions later, for now...we concentrate 
        on explaining how the XML declaration works okie!</p>
      	<p>All processing instructions, including the XML declaration should have the following syntax:<br><br> 		
      	<table border="1" cellpadding="0" width="99%" height="1">
        	<tr><td width="100%" height="1"><font color="black" size="1">&lt;?name .... ?&gt;</font></td></tr>
      	</table>
      	<p>It must begin with &lt;? and end with ?&gt;. Following the initial &lt;?, you will find the name 
        of the processing instruction, which in this case is &quot;xml&quot;. 
      	<p>The XML processing instruction,  requires that you specify a version attribute and allows you to specify 
        optional standalone and encoding attributes.<p>In its full regalia, the XML declaration might look like the following: 
      	<blockquote><p>&lt;?xml version=&quot;1.0&quot; standalone=&quot;yes&quot; encoding=&quot;UTF-8&quot;?&gt;&nbsp;</p></blockquote>
      	<h4>The Version Attribute</h4>
      	<p>As we have mentioned before, if you do decide to use the optional XML declaration, you must define 
        the version attribute. As of this writing, the current version of XML is 1.0.&nbsp;</p>
      	<p><img border="0" src="grafix/warn.gif" width="27" height="20">If you include the optional attributes, version must be specified first.</p>
      	<h4>The STANDALONE Attribute</h4>
      	<p>The standalone attribute specifies whether the document has any markup declarations that are defined 
        in a separate document. Thus, if standalone is set to &quot;yes&quot;, 
        the document is effectively self-contained and there are no extra markup 
        declarations in external DTD's. However, setting the standalone to &quot;no&quot; 
        leaves the issue open. Remember that the document may or may not access 
        external DTD's.</p>
      	<p>For examples:&nbsp;</p>  
      	<table border="0" cellpadding="0" cellspacing="0" width="99%">
        	<tr><td width="94%" colspan="2"><font color="black" size="1"><b>standalone_yes.xml</b></font></td></tr>
        	<tr><td width="94%" colspan="2"><font color="black" size="1">&lt;?xml version=&quot;1.0&quot; standalone=&quot;yes&quot; encoding=&quot;UTF-8&quot;?&gt;</font></td></tr>
        	<tr><td width="94%" colspan="2"><font color="black" size="1">&lt;book&gt;</font></td></tr>
        	<tr><td width="9%"></td><td width="85%"><font color="black" size="1">&lt;title&gt;Professional XML Design and Implementation&lt;/title&gt;</font></td></tr>
        	<tr><td width="9%"></td><td width="85%"><font color="black" size="1">&lt;author&gt;Paul Spencer&lt;/author&gt;</font></td></tr>
        	<tr><td width="9%"></td><td width="85%"><font color="black" size="1">&lt;publisher&gt;Wrox&lt;/publisher&gt;</font></td></tr>
        	<tr><td width="9%"></td><td width="85%"><font color="black" size="1">&lt;price&gt;$83.95&lt;/price&gt;</font></td></tr>
        	<tr><td width="94%" colspan="2"><font color="black" size="1">&lt;/book&gt;</font></td></tr>
      	</table>
      	<table border="0" cellpadding="0" width="99%" cellspacing="0">
        	<tr><td width="100%" colspan="2"><br><font color="black" size="1"><b>standalone_no.xml</b></font></td></tr>
        	<tr><td width="100%" colspan="2"><font color="black" size="1">&lt;?xml version=&quot;1.0&quot; standalone=&quot;no&quot; encoding=&quot;UTF-8&quot;?&gt;</font></td></tr>
        	<tr><td width="100%" colspan="2"><font color="black" size="1">&lt;!DOCTYPE book SYSTEM &quot;book.dtd&quot;&gt;</font></td></tr>
        	<tr><td width="100%" colspan="2"><font color="black" size="1">&lt;book&gt;</font></td></tr>
        	<tr><td width="9%"></td><td width="91%"><font color="black" size="1">&lt;title&gt;Professional XML Design and Implementation&lt;/title&gt;</font></td></tr>
        	<tr><td width="9%"></td><td width="91%"><font color="black" size="1">&lt;author&gt;Paul Spencer&lt;/author&gt;</font></td></tr>
        	<tr><td width="9%"></td><td width="91%"><font color="black" size="1">&lt;publisher&gt;Wrox&lt;/publisher&gt;</font></td></tr>
        	<tr><td width="9%"></td><td width="91%"><font color="black" size="1">&lt;price&gt;$83.95&lt;/price&gt;</font></td></tr>
        	<tr><td width="100%" colspan="2"><font color="black" size="1">&lt;/book&gt;</font></td></tr>
      	</table>
      	<p>Note: As you can see, if standalone=&quot;no&quot; which means the XML document should use an external 
        DTD. In this case, use book.dtd file to check for validating document.</p>   
      	<h4>The ENCODING Attribute</h4><p>All XML parsers must support 
        8-bit and 16-bit Unicode encoding (UTF-8 and UTF-16 respectively) corresponding 
        to ASCII. However, XML parsers may support a larger set.&nbsp;</p>
	]]></description>
	</sub-tree1>
    </group>
    <group name="XML Syntax - Elements"><description><![CDATA[<p>Once you have written your 
        XML declaration, you are ready to begin coding your XML document. To do so, you should understand the concept of elements. 
      	<p>Elements are the basic unit  of XML content. Syntactically, an element consists of a start tag, and an end tag, and everything in between. For example, consider the following element: 
      	<blockquote><p>&lt;name&gt;John Smith&lt;/name&gt;</p></blockquote>
      	<h3>Tags</h3><P>Tags are used <B>to markup elements</B>. A starting tag like &lt;name&gt; mark up the beginning of an element, and an ending tag like &lt;/name&gt;&nbsp; mark up the end of&nbsp; an element.</P>
      	<h3>Attributes</h3><P>Attributes provide <B>extra information about elements</B>.&nbsp;</P>
        <li>Attributes</li><li>Attributes always come in name/value pairs.&nbsp;</li>
      	<P>Let say, in our xml document - we have the following line:</P>
      	<P>&lt;img src=&quot;bird.gif&quot;/&gt;</P>       
      	<TABLE border=1 width="100%" cellspacing="0" cellpadding="0">
        	<TBODY><TR><TD width="67%" valign="top"><font color="black" size="1"><b>A line of code above</b></font></TD>
          		<TD width="99%" valign="top"><font color="black" size="1"><b>Explanation</b></font></TD></TR>
        	<TR><TD width="67%" valign="top"><font color="black" size="1">&lt;img src=&quot;bird.gif&quot;/&gt;</font></TD>
          		<TD width="133%" valign="top"><font color="black" size="1"><p>img is the element name<br>src is the attribute name<br>&quot;bird.gif&quot; is the attribute value<br>Since, img element is empty, it is closed by a &quot;/&quot;</p></font></TD></TR></TBODY> 
      	</TABLE>
      	<p><img border="0" src="grafix/warn.gif" width="27" height="20">Attribute always come in name/value pairs and attribute value must be quoted. </p>
	]]></description>	
	<sub-tree1 name="Character Data"><description><![CDATA[<p>XML defines the text between the start and end tags to be character data and the text within the tags to be markup.<p><img border="0" src="grafix/warn.gif" width="27" height="20">Since 
        the &quot;&lt;&quot; and &quot;&gt;&quot; are the reserved characters 
        for the start and end of a tag - respectively. Thus character data may 
        be any legal (Unicode) character except the &quot;&lt;&quot; and &quot;&gt;&quot; 
        can not be used. The following example is incorrect. 
      	<blockquote><p>&lt;comparison&gt;12 &lt; 13&lt;/comparison&gt;</blockquote>
      	<p><b>Alternative solution:</b><blockquote><p>&lt;comparison&gt;12 &amp;lt; 13&lt;/comparison&gt;</blockquote>
      	<p>Here is the question you might ask yourself.&nbsp; How am I supposed to know which characters that 
        legal or illegal to use? Well, not too worries - XML provides a couple 
        of useful entity references that you can use:<br><br>   
      	<table border="1" width="99%" cellpadding="0">
        	<tbody><tr><th width="103" height="19"><font color="black" size="1">Character</font></th>
          		<th width="204" height="19"><font color="black" size="1">Entity Reference</font></th>
          		<th width="263" height="19"><font color="black" size="1">Meaning</font></th></tr>
        	<tr><td width="103" height="19"><font color="black" size="1">&gt;</font></td>
          		<td width="204" height="19"><font color="black" size="1">&amp;gt;</font></td>
          		<td width="263" height="19"><font color="black" size="1">Greater than</font></td></tr>
        	<tr><td width="103" height="19"><font color="black" size="1">&lt;</font></td>
          		<td width="204" height="19"><font color="black" size="1">&amp;lt;</font></td>
          		<td width="263" height="19"><font color="black" size="1">Less than</font></td></tr>
        	<tr><td width="103" height="17"><font color="black" size="1">&amp;</font></td>
          		<td width="204" height="17"><font color="black" size="1">&amp;amp;</font></td>
          		<td width="263" height="17"><font color="black" size="1">Ampersand</font></td></tr>
        	<tr><td width="103" height="19"><font color="black" size="1">&quot;</font></td>
          		<td width="204" height="19"><font color="black" size="1">&amp;quot;</font></td>
          		<td width="263" height="19"><font color="black" size="1">Double quote</font></td></tr>
        	<tr><td width="103" height="19"><font color="black" size="1">'</font></td>
          		<td width="204" height="19"><font color="black" size="1">&amp;apos;</font></td>
          		<td width="263" height="19"><font color="black" size="1">Apostrophe (Single quote)</font></td></tr>
        	</tbody> 
      </table>&nbsp;<br>Obviously, the &lt; entity reference is useful for character data. The other 
      entity references can be used within markup in cases in which there could be confusion such as: 
      <blockquote><p>&lt;statement value=&quot;She said, &quot;Don't go there!&quot;&quot;&gt;</blockquote>
      <p>Which should be written as: 
      <blockquote><p>&lt;statement value=&quot;She said, &amp;quot;Don&amp;apos;t go there!&amp;quot;&quot;&gt;</p></blockquote>
      <p>By and large, tags make up the majority of XML markup. A tag 
      is pretty much anything between a &lt; sign and a &gt; sign that is not 
      inside a comment, or a CDATA section (Read on next section, please!).</p>
	]]></description>
	</sub-tree1>
	<sub-tree1 name="CDATA"><description><![CDATA[<P>CDATA also means character data. <B>CDATA is 
        text that will NOT be parsed by a parser</B>. Tags inside the text will 
        NOT be treated as markup and entities will not be expanded.</P>
      	<p>As we have said already, it is a pretty good rule of thumb to consider anything outside of tags 
        to be character data and anything inside of tags to be considered markup. 
        But alas, how am I going to show the &quot;&gt;&quot; or any other reserved 
        characters on the browser? and worse still, if I decide to have lots of 
        reserved characters to show up the browser, do I have to key in all the 
        funny entity reference symbols???  
      	<p>Of course not, XML has provided you a wonderful feature that you can use. That is the special case of 
        CDATA blocks, it is provided as a convenience measure when you want to 
        include large blocks of special characters as character data. By including 
        CDATA block, you actually tell the XML processor (browser) to treat everything 
        inside CDATA section just like any others ordinary character data. (that 
        means all tags and entity references are ignored by an XML processor)     
      	<p>Let's say you want to display XML document on the browser, you can construct your XML document as follow:<br>        
      	<table border="0" cellpadding="0" cellspacing="0" width="76%">
        	<tr><td width="100%" colspan="2"><font color="black" size="1">&lt;example&gt;</font></td></tr>
        	<tr><td width="7%"></td><td width="93%"><font color="black" size="1">&amp;lt;document&amp;gt;</font></td></tr>
        	<tr><td width="7%"></td><td width="93%"><font color="black" size="1">&amp;lt;name&amp;gt;Trina Thach&amp;lt;/name&amp;gt;</font></td></tr>
        	<tr><td width="7%"></td><td width="93%"><font color="black" size="1">&amp;lt;email&amp;gt;trina@technomusic.org&amp;lt;/email&amp;gt;</font></td></tr>
        	<tr><td width="7%"></td><td width="93%"><font color="black" size="1">&amp;lt;/document&amp;gt;</font></td></tr>
        	<tr><td width="100%" colspan="2"><font color="black" size="1">&lt;/example&gt;</font></td></tr>
      	</table>    
      	<p>As you can see, you would be forced to use entity references for all the tags. What's a mess! 
      	<p>Thus, to avoid the inconvenience of translating all special characters, you can use a CDATA block to specify 
        that all character data should be considered character data whether or 
        not it looks like a tag or entity reference. 
      	<p>Now, allow me to show you how easy it is by applying CDATA block within XML document:<br>
      	<table border="0" cellpadding="0" cellspacing="0" width="99%">
        	<tr><td width="99%" colspan="4"><font color="black" size="1">&lt;example&gt;</font></td></tr>
        	<tr><td width="11%"></td><td width="123%" colspan="3"><font color="black" size="1">&lt;![CDATA[</font></td></tr>
        	<tr><td width="11%"></td><td width="10%"></td><td width="99%" colspan="2"><font color="black" size="1">&lt;document&gt;</font></td></tr>
        	<tr><td width="11%"></td><td width="10%"></td><td width="10%"></td><td width="99%"><font color="black" size="1">&lt;name&gt;Trina Thach&lt;/name&gt;</font></td></tr>
        	<tr><td width="11%"></td><td width="10%"></td><td width="10%"></td><td width="99%"><font color="black" size="1">&lt;email&gt;trina@technomusic.org&lt;/email&gt;</font></td></tr>
        	<tr><td width="11%"></td><td width="10%"></td><td width="99%" colspan="2"><font color="black" size="1">&lt;/document&gt;</font></td></tr>
        	<tr><td width="11%"></td><td width="99%" colspan="3"><font color="black" size="1">]]&gt;</font></td></tr>
        	<tr><td width="134%" colspan="4"><font color="black" size="1">&lt;/example&gt;</font></td></tr>
      	</table><p> See how readable and legible it is??? 
      	<p> <img border="0" src="grafix/warn.gif" width="27" height="20">As you might have guessed, the character string ]]&gt; is not allowed within a CDATA block as it would signal the end of the CDATA block.</p>
	]]></description>
	</sub-tree1>
	<sub-tree1 name="PCDATA"><description><![CDATA[PCDATA means parsed character 
        data. Think of character data as the text found between the start tag 
        and the end tag of an XML element. <B>PCDATA 
        is the text that will be parsed by a parser</B>. Another word, the tags 
        inside the text will be treated as markup and entities will be expanded.&nbsp;
	]]></description>
	</sub-tree1>
	<sub-tree1 name="Comments"><description><![CDATA[<p>Not only will you sometimes 
        want to include tags in your XML document that you want the XML processor 
        will ignore (display as character data), but sometimes you will want to 
        put character data in your document that you want the XML processor to 
        ignore (not display at all). This type of text is called Comment text. 
      	<p>In HTML, you specified comments using the &lt;!-- and --&gt; syntax. Well, I have some good news. In XML, 
        comments are done in just the same way! So the following would be a valid XML comment:&nbsp; 
      	<blockquote><p>&lt;!-- Begin the Names --&gt;<br>
          	&lt;name&gt;Jim Nelson&lt;/name&gt;<br>
          	&lt;name&gt;Sam Sanger&lt;/name&gt;<br>
          	&lt;name&gt;Les Moore&lt;/name&gt;<br>
          	&lt;!-- End the names --&gt; </p></blockquote>
      	<p>When using comments in your XML documents, however, you should keep in mind a couple of rules. </p>
      	<p><img border="0" src="grafix/warn.gif" width="27" height="20">Should 
        not have &quot;-&quot; or &quot;--&quot; within the text of your comment as it might be confusing to the XML processor. 
      	<p><img border="0" src="grafix/warn.gif" width="27" height="20">Never 
        ever place a comment within a tag. Thus, the following code would be poorly-formed XML <blockquote> 
        <p>&lt;name &lt;!--The name --&gt; &gt;Peter Williams &lt;/name&gt;</blockquote>
      	<p><img border="0" src="grafix/warn.gif" width="27" height="20">Likewise, 
        never place a comment inside of an entity declaration and never place 
        a comment before the XML declaration that must always be the first line in any XML document. 
      	<p align="left">Comments can be used to comment out tag sets. Thus, in the following case, all the names will be ignored except for Barbara Tropp. 
      	<blockquote><p align="left"><font size="1">&lt;!-- don't show these&nbsp;<br>
          	&lt;name&gt;David Drinkwater&lt;/name&gt;<br>
          	&lt;name&gt;Joe Smith&lt;/name&gt;<br>
          	&lt;name&gt;John Paul Young&lt;/name&gt;<br>
          	--&gt;<br>
          	&lt;name&gt;Barbara Tropp&lt;/name&gt;</font></p></blockquote>
      	<p align="left">However, if you do comment out blocks of tags, make sure that the remaining XML is well-formed.</p>
	]]></description>
	</sub-tree1>
	<sub-tree1 name="Processing Instructions"><description><![CDATA[<p>We have already seen a processing 
        instruction. The XML declaration is a processing instruction. And if you 
        recall, when we introduced the XML declaration we promised to return to 
        the concept of processing instructions to explain them as a category.</p>
      	<p>So here we are.<br><br>
      	<table border="1" cellpadding="0" width="99%">
        <tr><td width="100%"><font color="black">A 
            processing instruction is a bit of information meant for the application 
            using the XML document. That is, they are not really of interest to 
            the XML parser. Instead, the instructions are passed intact straight 
            to the application using the parser.</font></td></tr>
      	</table><p>The application can then pass this on to another application or interpret it itself. <p>All processing instructions follow the generic format of:<br><br>
      	<table border="1" cellpadding="0" width="99%">
        	<tr><td width="100%"><font color="black" size="1">&lt;?name_of_app_instruction_is_for_instructions?&gt;&nbsp;</font></td></tr>
      	</table><p>As you might imagine, you cannot use any combination of &quot;xml&quot; as the name_of_application_instruction_is_for 
        since &quot;xml&quot; is reserved. However, you might have something like: 
      	<blockquote><p>&lt;?JAVA_OBJECT JAR_FILE=&nbsp; &quot;/java/myjar.jar&quot;?&gt;</p></blockquote>   
	]]></description>
	</sub-tree1>
    </group>
    <group name="XML Syntax - Entities"><description><![CDATA[<p>Actually I should have leave 
        this topic till we talk about writing the valid documents rather than 
        writing well-formed documents. Nevertheless, some issues make sense within 
        this section, because entities must be well-formed as well as valid. So, 
        what I am going to do is to introduce entities in terms of their basic 
        syntax and leave the advance stuff for a little bit later.  
      	<p>Entities are variables used to <B>define common text</B> that allow you to refer to large sections 
        of text without having to type them out every time you want to use them. 
        Suppose you have your letterhead saved as an entity in a shared file. 
        Then, every time you write a letter in XML, you might say something like: 
      	<p> &lt;letter&gt;<br>
        &amp;letterhead;<br>
        &lt;to&gt;Bob Frog&lt;/to&gt;<br>
        &lt;body&gt;<br>
        blah blah blah<br>
        &lt;/body&gt;<br>
        &lt;from&gt;Kevin Kelly&lt;/from&gt;<br>
        &lt;/letter&gt; </p>
      	<p> Notice that the letterhead might expand out to: </p>
      	<p> My Company<br>
        13 Fairy Street<br>
        Suite 156<br>
        Bankstown, Sydney 2196.</p>
      	<p>However, instead of typing that out in every letter, you just use:</p>
      	<p>&amp;letterhead; <p>There are two types of entities, general and parameter entities and each entity has two parts, the declaration and the entity reference.</p>
	]]></description>
	<sub-tree1 name="General Entities"><description><![CDATA[<p>Look like the following in the real world: 
      	<p align="left"><b>Note</b>: 
        You can also specify an entity that has text defined externally to the 
        document by using the SYSTEM keyword such as:</p>
      	<p align="left"> &lt;!ENTITY license_agreement SYSTEM &quot;http://www.mydomain.com/license.xml&quot;&gt;</p>
      	<p align="left">In this case, the XML processor will replace the entity reference with the contents of the document specified.</p>     
	]]></description>
	</sub-tree1>
	<sub-tree1 name="Parameter Entities"><description><![CDATA[<p>Parameter entities, that 
        can also be either internal or external and keep in mind that they are 
        only used within the DTD. To avoid misleading, let's us defer a serious 
        discussion on this topic for later. For now, all you have to know is that 
        a well-formed parameter entity will look the same as a general entity 
        except that it will include the &quot;%&quot; specifier. Consider the 
        following example: 
      	<p>&lt;!ENTITY % NAME &quot;text that you want to be represented by the entity&quot;&gt;</p>      
	]]></description>
	</sub-tree1>
	<sub-tree1 name="DOCTYPE Declarations"><description><![CDATA[<p>If you want to declare entities, 
        you must do so within the document DOCTYPE declaration that always follows 
        the prolog (DTD and xml Declaration) and looks like the following:<br>
      	<br><div align="justify">
        <table border="1" cellpadding="0" width="99%">
          <tr><td width="100%" height="107"><font color="black" size="1">
              &lt;?xml version=&quot;1.0&quot;?&gt;<br>
              &lt;!DOCTYPE my_document [&nbsp;<br>
              &nbsp;...here is where you declare your entities....<br>
              ]&gt;<br>
              &lt;my_document&gt;<br>
              &nbsp;...here is the body of your document....<br>
              &lt;/my_ocument&gt;</font></td></tr>
        </table></div>
      	<p>Thus, you might have something like the following: 
      	<p><font size="1"> &lt;?xml version=&quot;1.0&quot;?&gt;<br>
        &lt;!DOCTYPE clients [&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
        &lt;!ENTITY nineth_floor_address &quot;2345 Broadway St Floor 9&quot;&gt;<br>
        &lt;!ENTITY eighth_floor_address &quot;2345 Broadway St Floor 8&quot;&gt;<br>
        &lt;!ENTITY seventh_floor_address &quot;2345 Broadway St Floor 7&quot;&gt;<br>
        ]&gt;<br>
        &lt;clients&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;client&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;Willy Smith&lt;/name&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp; &lt;address&gt;&amp;nintha_floor_address;&lt;/address&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;phone&gt;x345&lt;/phone&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/client&gt;<br>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;client&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;Jet Li&lt;/name&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;address&gt;&amp;ninth_floor_address;&lt;/address&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;phone&gt;x111&lt;/phone&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/client&gt;<br>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;client&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;John Drayton&lt;/name&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;address&gt;&amp;ninth_floor_ddress;&lt;/address&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;phone&gt;x346&lt;/phone&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/client&gt;<br>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;client&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;David Drinkwater&lt;/name&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;address&gt;&amp;seventh_floor_address;&lt;/address&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;phone&gt;x289&lt;/phone&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/client&gt;<br>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;client&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;Kristin Kelly&lt;/name&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;address&gt;&amp;eighth_floor_address;&lt;/address&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;phone&gt;x945&lt;/phone&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/client&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/clients&gt; </p></font>
      	<p>Consider how much easier changing office addresses is when you use entities!!!</p>     
	]]></description>
	</sub-tree1>
	<sub-tree1 name="Entity References"><description><![CDATA[<p>Entity Reference refers 
        to two types: Entity reference to General Entities and Parameter Entities. 
        Let's us cover them one by one.</p>
      	<h4>Entity Reference - Referring to General Entities</h4>
      	<p>Well we have pretty much let the cat out of the bag already. We have shown several examples of 
        entity references above. Let's us take even a closer look of what we have 
        covered before! oh! I am trying to make it short and simple, okay! 
      	<p>So what is entity reference? Entity References refer to the key that unlocks an entity which has been 
        declared in an Entity Declaration. Entity References follow the simple syntax of:<br><br>
      	<table border="1" cellpadding="0" width="99%">
        	<tr><td width="100%"><font color="black" size="1">&amp;entity_name;</font></td></tr>
      	</table><p>such as<blockquote><p>&amp;letterhead; </blockquote>
      	<p><img border="0" src="grafix/warn.gif" width="27" height="20">Entities must be declared in an XML document before they are referenced. 
      	<p><img border="0" src="grafix/warn.gif" width="27" height="20">Should 
        not have any whitespace embedded in an entity reference. In other words, 
        &amp; letterhead; or &amp;letterhead ; will cause errors. 
      	<p><img border="0" src="grafix/warn.gif" width="27" height="20">Though 
        entities may refer to other entities, they may not be self-referential 
        either directly or indirectly. So the following declarations are not allowed.<br><br>
      	<table border="1" cellpadding="0" cellspacing="0" width="99%">
        	<tr><td width="46%"><font color="black" size="1"><b>Example1</b></font></td><td width="54%"><font color="black" size="1"><b>Explanation</b></font></td></tr>
        	<tr><td width="46%"><font color="black" size="1">&lt;!ENTITY net &quot;Talk about the &amp;net;&quot;&gt;</font></td><td width="54%"><font color="black" size="1">Entity contains references to itself (direct)</font></td></tr>
      	</table>
      	<p>&nbsp;<table border="1" cellpadding="0" cellspacing="0" width="99%">
        <tr><td width="46%"><font color="black" size="1"><b>Example2</b></font></td><td width="54%"><font color="black"><b>Explanation</b></font></td></tr>
        <tr><td width="46%"><font color="black" size="1">&lt;!ENTITY 
            one &quot;refer to &amp;two;&quot;&gt;<br>
            &lt;!ENTITY two &quot;refer to &amp;one;&quot;&gt;</font></td>
          <td width="54%"><font color="black" size="1">Entities contains reference to themselves (indirect)</font></td></tr>
	</table>
    <p>But entities can refer to other entities as long as there is no direct or indirect self-reference of the type above. So we can have:
    <p>&lt;!ENTITY where&nbsp;&nbsp;&nbsp; 
        &quot;the mat.&quot;&gt;<br>
        &lt;!ENTITY didwhat &quot;sat on &amp;where;&quot;&gt;<br>
        &lt;!ENTITY who&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;The cat &amp;didwhat;&quot;&gt;
    <p>If we then used the reference &amp;who; within the content of an element, the entity references would be expanded by the parser, and the replacement text formed to give &quot;The cat sat on the mat.&quot; 
    <p><img border="0" src="grafix/warn.gif" width="27" height="20">References to entities may not appear in the DOCTYPE declaration. 
    <p><img border="0" src="grafix/warn.gif" width="27" height="20">The text that the entity references must be well-formed XML. 
    <h4>Entity Reference - Referring to Parameter Entities</h4>
    <p>As you might expect parameter entity references work much like general entity references. In this case, we use a &quot;%&quot; sign instead of a &quot;&amp;&quot;.<br><br>
    <table border="1" cellpadding="0" width="99%">
       	<tr><td width="100%"><font color="black" size="1">%parameter_entity_name;</font></td></tr>
    </table>
    <p>Before we leave the subject, I would only mention that you could also use entity references within tag attributes. For example, consider the following: 
    <p>&lt;invoice client=&quot;&amp;IBM;&quot; product=&quot;&amp;PRODUCT_ID_8762;&quot; quantity=&quot;5&quot;&gt; 
    <p align="left"><img border="0" src="grafix/warn.gif" width="27" height="20">You may not reference an external entity from within element attributes. 
    <p align="left"><img border="0" src="grafix/warn.gif" width="27" height="20">The referenced text may not contain the &lt; character because it would cause a well-formed error in the element when replaced.
	]]></description>
	</sub-tree1>
    </group>
</category>
</body>
</head>
</html>
</tutorial>	
