<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" "http://cnx.rice.edu/technology/cnxml/schema/dtd/0.5/cnxml_plain.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="new">
  <name>Web Programming Quick Start: XHTML -- Creating an Initial XHTML File</name>
  <metadata>
  <md:version>1.8</md:version>
  <md:created>2006/09/04 08:48:20 GMT-5</md:created>
  <md:revised>2007/01/03 06:57:14.294 US/Central</md:revised>
  <md:authorlist>
      <md:author id="sawey">
      <md:firstname>Ronald</md:firstname>
      <md:othername>M.</md:othername>
      <md:surname>Sawey</md:surname>
      <md:email>sawey@txstate.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="sawey">
      <md:firstname>Ronald</md:firstname>
      <md:othername>M.</md:othername>
      <md:surname>Sawey</md:surname>
      <md:email>sawey@txstate.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>&lt;!DOCTYPE ...&gt;</md:keyword>
    <md:keyword>&lt;body&gt;</md:keyword>
    <md:keyword>&lt;em&gt;</md:keyword>
    <md:keyword>&lt;head&gt;</md:keyword>
    <md:keyword>&lt;html&gt;</md:keyword>
    <md:keyword>&lt;p&gt;</md:keyword>
    <md:keyword>&lt;strong&gt;</md:keyword>
    <md:keyword>&lt;title&gt;</md:keyword>
    <md:keyword>Dreamweaver</md:keyword>
    <md:keyword>HTML</md:keyword>
    <md:keyword>XHTML</md:keyword>
  </md:keywordlist>

  <md:abstract>This module discusses the creation of an initial XHTML file. The basic structure of any XHTML file is discussed and the &lt;html&gt;, &lt;head&gt;, &lt;title&gt;, &lt;body&gt;, &lt;p&gt;, &lt;strong&gt; and &lt;em&gt; tags are discussed.</md:abstract>
</metadata>
  
  <content>
  <section id="modulemap">
			<name>Module Map</name>
			<para id="mmap1">
				<list id="maplinks1">
					<item>
						<link src="#intro">Introduction</link>
					</item>					
					<item>
						<link src="#introduction">Dreamweaver</link>
					</item>
					<item>
						<link src="#codeexpo1">The "Sine Qua Non" XHTML Tags</link>
					</item>
					<item>
						<link src="#strongem">The &lt;strong&gt; and &lt;em&gt; Tags</link>
					</item>
					<item>
						<link src="#conclusion">Conclusion</link>
					</item>
				</list>
			</para>
		</section>
  
  <section id="intro">
  <name>Introduction</name>
  	<para id="introa">
	The primary goal of this "Web Programming Quick Start" series is to get 
	the reader to the point of doing something productive
	with a minimum of time and effort.  It is not
	intended to be an exhaustive treatment/reference of any of the subjects discussed.  
	This is also very much a work in progress.  All comments, criticisms, suggestions, etc. are most 
	<link src="mailto:rs01@txstate.edu">welcome</link>.
	</para>
	
	<para id="introb">In the series of <link src="http://www.cs.txstate.edu/~rs01/web_programming/links.html">modules</link> on XHTML (eXtensible HyperText Markup Language) 
	and CSS (Cascading Style Sheets), we
	will
	be following the "current wisdom" on web page construction and design as exemplified by the three excellent web-related books of 
	<link src="http://cnx.org/content/m12836/latest/#andrew01">Rachael Andrew</link>.  Specifically, we will endeavor to keep the
	<emphasis>content</emphasis> and the <emphasis>styling/formatting</emphasis> of the web documents 
	<emphasis>separate</emphasis>.
	</para>
	<para id="introc">A <link src="http://apollo.cs.txstate.edu/rs01/media/cnx/xhtml/module1/module1.html">screen 
	recording</link>, 
	demonstrating the material in this module
	is also available (time permitting).
	</para>
	
  </section>
  
  <section id="introduction">
			<name>Dreamweaver</name>
    <para id="intro1">
       <!-- Insert module text here -->
	   Although the work discussed here 
	   can be done with any text editor, and there are also many X/HTML generators, we will use 
	   Adobe's Macromedia Dreamweaver 8 for 		       
	   generating our HTML.  However, at each step, we will discuss the XHTML code, generated by Dreamweaver.  
	   One reason for using
	   Dreamweaver in this discussion is that it will be very helpful when we discuss Cascading Style Sheets (<link src="#">CSS</link>).
    </para> 
	<para id="intro2">
	Once you have started Dreamweaver (we are assuming a Microsoft Windows operating system), click on: File/New on the menu bar.  
	  <cnxn target="dw1a"/> shows the resulting dialog box.
	
				<figure id="dw1a">
					<media type="image/gif" src="dw1a.gif"/>
					<caption>Dreamweaver's New Document Dialog Box</caption>
				</figure>
	Choose "Basic page" from the Category column and "HTML" from the Basic page column, and click on: 
	<media type="image/gif" src="create.gif"/>.
	</para>
	
	<para id="intro3">
	<cnxn target="dwterms1"/> shows the Dreamweaver working environment.  
	Throughout this "Web Programming Quick Start" series
	as we discuss XHTML generation by Dreamweaver, we will use the terms shown in this figure.
	
				<figure id="dwterms1">
					<media type="image/gif" src="dwterms1.gif"/>
					<caption>Dreamweaver's Working Environment</caption>
				</figure>
	</para>
	
	<para id="intro4">
	To get a look at the XHTML code generated by Dreamweaver, click on the <media type="image/gif" src="code.gif"/> button, on the 
	Document Toolbar. <cnxn target="code1"/> shows the resulting Document Window.
				<figure id="code1">
					<media type="image/gif" src="code1.gif"/>
					<caption>Dreamweaver's Initial XHTML</caption>
				</figure>
	
	<link src="demo1.html">demo1.html</link> shows the file thus far.  View/Page Source (in the Firefox browser) will show the XHTML
	code.			
	</para>
    
	</section>  
	
	<section id="codeexpo1">
	<name>The "Sine Qua Non" XHTML Tags</name>
	
	<para id="intro5">
	We now discuss each line of the XHTML code shown in <cnxn target="code1"/>. Although there are comments associated with 
	lines 1, 2 
	and 4, they are not the primary focus here.
	</para>  
	<para id="intro5aa">
	The "&lt;" and "&gt;" angle brackets, along with the text contained between them are called "tags,"  e.g. 
	&lt;body&gt; .
	
	<list id="codelist1" type="bulleted">
	  
	  <item>Line 1: <code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XH...&gt; </code> tells the browser what kind of file follows.
	  We will omit a detailed discussion at this point.
	  </item>
	  
	  <item>Line 2: <code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; </code>The &lt; html part begins the XHTML "tags,"
	  and the remainder of the line, provides information to the browser concerning the "XML Namespace" associated.  As with Line 2, 
	  namespace 
	  discussion is beyond the scope of our work, and both lines 1 and 2 should be taken as "boilerplate." 
	  </item>
	  
	  <item>Line 3: <code>&lt;head&gt;</code>This begins the "head" section of the web document. This section contains material that does
	   not
	  appear in document window of a browser, but generally contains information used by the browser. 
	  </item>
	  
	  <item>Line 4: <code>&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt; </code>
	  As with lines 1 and 2, we take this as "boilerplate," generated by Dreamweaver to make the code XHTML compliant. 
	  </item>
	  
	  <item>Line 5: <code>&lt;title&gt;Untitled Document&lt;/title&gt; </code>Text contained between &lt;title&gt; and
	  &lt;/title&gt; tags appears in the title bar of the browser.  Our next step will be to change this to something more "meaningful."
	  </item>
	  
	  <item>Line 6: <code>&lt;/head&gt; </code>This ends the head section of the document 
	  </item>
	  
	  <item>Line 7: <code> </code>Blank line for readability. 
	  </item>
	  
	  <item>Line 8: <code>&lt;body&gt; </code>This begins the "body" section. This is where the material appearing in the browser 
	  window is
	  specified.
	  </item>
	  

	  <item>Line 9: <code>&lt;/body&gt; </code>Closing of the body of the document.  Since there is nothing between the beginning and
	  the
	  end of the body tags, the browser will show a blank document 
	  </item>
	  

	  <item>Line 10: <code>&lt;/html&gt; </code>This final tag closes the XTHML document, as well as closing the &lt;html&gt; tag opened 
	  in line 2. 
	  </item>
	
	</list>
	
	<note id="note2">After Line 1, each tag discussed has an opening, &lt; ... &gt;, and a closing &lt;/...&gt; tag. This is true of all 
	XTHML tags
	that contain text between their opening and closing, i.e. "non-empty" tags. 
	</note>
	
	</para>
	
	<para id="intro5a">
	To emphasize the overall structure, <cnxn target="code1a"/> shows the XHTML tags without the recommended "boilerplate," that is
	required to make the file an XHTML file, rather than an HTML file.
	
		<figure id="code1a">
					<media type="image/gif" src="code1a.gif"/>
					<caption>Dreamweaver's Initial XHTML, without "boilerplate"</caption>
		</figure>
	
	</para>
	
	<para id="intro6">
	Let's now put two paragraphs in the body of our document and change the text between the title tags.  We will get our 
	paragraphs of text 
	from <link src="http://www.lipsum.com">lipsum.com</link>.  <cnxn target="code2"/> shows the XHTML code and <cnxn target="browser1"/> 
	shows the result displayed in the Firefox browser.
	
				<figure id="code2">
					<media type="image/gif" src="code2.gif"/>
					<caption>Adding text to the body and changing the title</caption>
				</figure>
				
				<figure id="browser1">
					<media type="image/gif" src="browser1.gif"/>
					<caption>Browser view for demo2.html</caption>
				</figure>			
	
	<link src="demo2.html">demo2.html</link> shows the file thus far.  Recall, View/Page Source (in the Firefox browser) will show the 
	XHTML code.
	</para>
	
	<para id="intro7">
	You will notice that although the two paragraphs in the source code (demo2.html) are separated by a blank line, they appear as one 
	in the browser.  This demonstrates an important point: Browsers put all text together unless specified otherwise by XHTML code.  
	Blank lines are ignored, and the text is "flowed" to fit the browser window. 
	Although it is not shown here, all consecutive blanks and/or tabs are represented by a <emphasis>single</emphasis> space in the 
	browser, unless specified otherwise by XHTML code.  
	</para>
	
	<para id="intro7a">
	<cnxn target="code3"/> shows the insertion of the &lt;p&gt; and &lt;/p&gt;, "paragraph," tags 
	at the beginning and end of each of the two paragraph and <cnxn target="browser2"/> shows the result in the Firefox browser. 
	
				<figure id="code3">
					<media type="image/gif" src="code3.gif"/>
					<caption>Adding &lt;p&gt; and &lt;/p&gt; to each Paragraph</caption>
				</figure>
				
				<figure id="browser2">
					<media type="image/gif" src="browser2.gif"/>
					<caption>Browser view for demo3.html</caption>
				</figure>			
	
	<link src="demo3.html">demo3.html</link> shows the file constructed thus far.  Recall, 
	View/Page Source (in the Firefox browser) will show the
	XHTML code.
	
	</para>
	
	</section>
	
	<section id="strongem">
	<name>The &lt;strong&gt; and &lt;em&gt; Tags</name>
	
		<para id="intro9">
		We will conclude this section by discussing two more XHTML tags for "emphasizing" certains segments of text.  These are the 
		&lt;strong&gt; and &lt;em&gt; and tags.  To distinguish between the two,  
		<link src="http://cnx.org/content/m12836/latest/#andrew01">Andrew</link> (p. 66) suggests the following: 
		"Think of &lt;strong&gt; as a loud, slow voice, and and &lt;em&gt; as a raised tone of voice."
		</para>
		
		<para id="intro10">
		<cnxn target="code4"/> shows the insertion of the &lt;strong&gt; and &lt;em&gt; tags. &lt;em&gt; is used in the first paragraph 
		and &lt;strong&gt; is used in the second paragraph, and <cnxn target="browser3"/> shows the result in the Firefox browser.
	
				<figure id="code4">
					<media type="image/gif" src="code4.gif"/>
					<caption>Adding &lt;strong&gt; and &lt;em&gt; tags</caption>
				</figure>
				
				<figure id="browser3">
					<media type="image/gif" src="browser3.gif"/>
					<caption>Browser view for demo4.html</caption>
				</figure>			
	
		<link src="demo4.html">demo4.html</link> shows the file.  Recall, View/Page Source (in the Firefox browser) will show the XHTML
		code.
	</para>
	
	
	</section>
	<section id="conclusion">
	<name>Conclusion</name>
	<para id="intro11">
	The following might also be helpful:
		<list id="conclusisonlist"><item><link src="http://www.cs.txstate.edu/~rs01/web_programming/links.html">Links</link> to the other modules in this 
			"Web Programming Quick Start" series are available</item>
			<item>
			<link src="http://apollo.cs.txstate.edu/rs01/media/cnx/links.html">Links
			</link> 
			 to other screen recordings for these modules are also available (time permitting).
			</item>
		</list>
	</para>
	</section>
	
  </content>
  
</document>
