<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/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="m9007">

  <name>The Advanced CNXML</name>

  <metadata>
  <md:version>2.22</md:version>
  <md:created>2001/02/02</md:created>
  <md:revised>2004-02-24T17:51:26Z</md:revised>
  <md:authorlist>
    <md:author id="rars">
      <md:firstname>Ricardo</md:firstname>
      <md:othername>Anthony</md:othername>
      <md:surname>Radaelli-Sanchez</md:surname>
      <md:email>ricky@alumni.rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="mizar">
      <md:firstname>Christine</md:firstname>
      
      <md:surname>Donica</md:surname>
      <md:email>mizar@alumni.rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="selc">
      <md:firstname>Sarah</md:firstname>
      
      <md:surname>Coppin</md:surname>
      <md:email>coppin@alumni.rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="jenn">
      <md:firstname>Jenn</md:firstname>
      <md:othername>A.</md:othername>
      <md:surname>Drummond</md:surname>
      <md:email>jenn@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="brentmh">
      <md:firstname>Brent</md:firstname>
      <md:othername>Michael</md:othername>
      <md:surname>Hendricks</md:surname>
      <md:email>brentmh@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>solution</md:keyword>
    <md:keyword>term</md:keyword>
    <md:keyword>example</md:keyword>
    <md:keyword>exercise</md:keyword>
    <md:keyword>definition</md:keyword>
    <md:keyword>meaning</md:keyword>
    <md:keyword>rule</md:keyword>
    <md:keyword>statement</md:keyword>
    <md:keyword>proof</md:keyword>
    <md:keyword>table</md:keyword>
    <md:keyword>elem</md:keyword>
    <md:keyword>categories</md:keyword>
    <md:keyword>category</md:keyword>
    <md:keyword>group</md:keyword>
    <md:keyword>problem</md:keyword>
  </md:keywordlist>

  <md:abstract>This is the final installment of my three
  part tutorial on the CNXML language.  It is currently valid for the
  most recent
  release of the 0.3 language.  The keywords contain a list of the
  tags described in this tutorial.  Along with the example code in
  this module there is also an example module that has been growing
  throughout the tutorial.
  </md:abstract>
</metadata>

  <content>
    <section id="code">
      <name>Code</name>
      <para id="codelp1">
	The <code>code</code> tag is used to insert example computer
	output/input as either inline text within a paragraph or as a
	block of text.  To see which tags it may contain or be inside,
	consult the <link src="http://cnx.rice.edu/technology/cnxml/0.5/spec">CNXML
	Spec</link>. The <code>code</code> tag has a <code>type</code>
	attribute with two possible values.
	<list id="code_list">
	  <item>
	    <code>inline</code> (default) - used to specify code that
	    is inline.</item>
	  <item>
	    <code>block</code> - used to specify code that should be
	    in a separate block of text.</item>
	</list>
      </para>

      <example id="codelexamp">
	<code type="block">
	  <![CDATA[
<para id='copy'>
  In a unix terminal the command to copy a file is <code
  type='inline'>cp original copy</code>.
</para>
	  ]]>
	</code>
	<para id="copy">
	  In a unix terminal the command to copy a file is <code type="inline">cp original copy</code>
	</para>
      </example>
    </section>

    <section id="exercise">
      <name>Exercise</name>
      <para id="exercisep1">
	The <code>exercise</code> tag provides a tag for authors to
	add practice problems into their documents.  The
	<code>exercise</code> tag has a required <code>id</code>
	attribute and has two child tags, <code>problem</code> and
	<code>solution</code>.  The <code>problem</code> tag and the
	<code>solution</code> tag have no attributes.
      </para>
      <para id="qml">
	To create more complex answers, such as multiple-choice,
	multiple-response, ordered-response, and text-response
	questions, QML (Questions Markup Language) may used in place
	of the problem and solution tags.  For more information,
	please see the information about <link src="http://cnx.rice.edu/qml/intro/qml.xml">QML</link>.
      </para>
      <example id="exerexam">
	<code type="block">
	  <![CDATA[
<exercise id='grilltest'>
  <problem>
    <para id='grilltestp1'>
      For food safety, a steak should be cooked to a minimum
      temperature of what?
    </para>
  </problem>
  <solution>
    <para id='sol1p1'>
      160&deg; F or until the juices run clear and the meat is no
      longer pink.
    </para>
  </solution>
</exercise>
	  ]]>
	</code>
	<exercise id="grilltest">
	  <problem>
	    <para id="grilltestp1">
	      For food safety, a steak should be cooked to a minimum
	      temperature of what?
	    </para>
	  </problem>
	  <solution>
	    <para id="sol1p1">
	      160° F or until the juices run clear and the meat is
	      no longer pink
	    </para>
	  </solution>
	</exercise>
      </example>
    </section>

    <section id="calstable">
      <name>CALS Table</name>
      <para id="calsp1">
	CNXML uses the industry standard <link src="http://www.oasis-open.org/specs/a502.htm">CALS Table
	  Model</link> for including tables into CNXML documents.
	  Provided below is a brief description of the CALS tags,
	  their attributes, and children (along with <cnxn target="grilltemp">a helpful example</cnxn>).  For a more
	  complete description of the CALS Table consult the <link src="http://www.oasis-open.org/specs/a502.htm">CALS Table
	  Spec</link>.
      </para>

      <section id="tablesec">
	<name>table</name>
	<para id="table">
	  The <code>table</code> tag marks the beginning of a table.
	  It has an optional first child of <cnxn target="name" document="m9000">name</cnxn> and must contain one or more
	  <cnxn target="tgroup">tgroup</cnxn> tags.  The
	  <code>table</code> tag also has many attributes, to find out
	  more information consult the <link src="http://www.oasis-open.org/specs/a502.htm">CALS Table
	  Spec</link>.
	</para>
      </section>

      <section id="tgroupsec">
	<name>tgroup</name>
	<para id="tgroup">
	  The <code>tgroup</code> tag marks the beginning of a new
	  portion of a <cnxn target="table">table</cnxn>.  It has a
	  required attribute <code>cols</code> which is the number of
	  columns in the <code>tgroup</code>.  Its children tags are
	  zero, one, or more <cnxn target="colspec">colspec</cnxn> or
	  <cnxn target="spanspec">spanspec</cnxn>, zero or one <cnxn target="thead">thead</cnxn> or <cnxn target="tfoot">tfoot</cnxn>, and one <cnxn target="tbody">tbody</cnxn> tag.
	</para>
      </section>

      <section id="colspecsec">
	<name>colspec</name>
	<para id="colspec">
	  The <code>colspec</code> tag is an <term>empty tag</term>
	  that specificies the column of a <cnxn target="table">table</cnxn> or <cnxn target="entrytbl">entrytbl</cnxn>.  The names and numbers
	  specified as attributes are used for referencing by other
	  tags.
	</para>
      </section>

      <section id="spanspecsec">
	<name>spanspec</name>
	<para id="spanspec">
	  The <code>spanspec</code> tag is an empty tag that
	  identifies a horizontal span of columns and associated
	  attributes that can subsequently be referenced by its
	  spanname for repeated use in <cnxn target="entry">entry</cnxn> or <cnxn target="entrytbl">entrytbl</cnxn> in different <cnxn target="row">rows</cnxn>.
	</para>
      </section>

      <section id="theadsec">
	<name>thead</name>
	<para id="thead">
	  The <code>thead</code> tag identifies the heading <cnxn target="row">row</cnxn> of a <cnxn target="tgroup">tgroup</cnxn> or <cnxn target="entrytbl">entrytbl</cnxn>.  The <code>thead</code>
	    tag can have zero, one, or more <cnxn target="colspec">colspec</cnxn> tags and one or more <cnxn target="row">row</cnxn>.
	</para>
      </section>

      <section id="tfootsec">
	<name>tfoot</name>
	<para id="tfoot">
	  The <code>tfoot</code> tag identifies the <cnxn target="row">rows</cnxn> of footer information that are
	    displayed after the <cnxn target="tbody">tbody</cnxn>.
	    The <code>tfoot</code> tag can have zero, one, or more
	    <cnxn target="colspec">colspec</cnxn> tags and one or more
	    <cnxn target="row">row</cnxn>.
	</para>
      </section>

      <section id="tbodysec">
	<name>tbody</name>
	<para id="tbody">
	  The <code>tbody</code> tag identifies the body of a <cnxn target="tgroup">tgroup</cnxn> or <cnxn target="entrytbl">entrytbl</cnxn>.  The <code>tbody</code>
	    tag must have one or more <cnxn target="row">row</cnxn>
	    tags.
	</para>
      </section>

      <section id="rowsec">
	<name>row</name>
	<para id="row">
	  The <code>row</code> tag identifies the row of information
	  in a <cnxn target="thead">thead</cnxn>, <cnxn target="tbody">tbody</cnxn>, or <cnxn target="tfoot">tfoot</cnxn>.  The <code>row</code> tag must
	  have one or more <cnxn target="entry">entry</cnxn> or <cnxn target="entrytbl">entrytbl</cnxn>.
	</para>
      </section>

      <section id="entrytblsec">
	<name>entrytbl</name>
	<para id="entrytbl">
	  The <code>entrytbl</code> tag takes the place of an <cnxn target="entry">entry</cnxn>, but fits into a single <cnxn target="row">row</cnxn> of <cnxn target="tbody">tbody</cnxn> in a <cnxn target="tgroup">tgroup</cnxn>.  The content model is the
	  same as that of a <cnxn target="tgroup">tgroup</cnxn> except
	  that <cnxn target="tfoot">tfoot</cnxn> is ommitted and
	  <code>entrytbl</code> is self-excluding.  Its children tags
	  are zero, one, or more <cnxn target="colspec">colspec</cnxn>
	  or <cnxn target="spanspec">spanspec</cnxn>, zero or one
	  <cnxn target="thead">thead</cnxn> or <cnxn target="tfoot">tfoot</cnxn>, and one <cnxn target="tbody">tbody</cnxn> tag.
	</para>
      </section>
      
      <section id="entrysec">
	<name>entry</name>
	<para id="entry">
	  The <code>entry</code> tag identifies an entry in a <cnxn target="row">row</cnxn>.  The <code>entry</code> tag
	  contains ASCII text and zero, one, or many <cnxn target="cite" document="m9000">cite</cnxn>, <cnxn target="term" document="m9000">term</cnxn>, <cnxn target="cnxn" document="m9000">cnxn</cnxn>, <cnxn target="link" document="m9000">link</cnxn>, <cnxn target="code" document="m9006">code</cnxn>, <cnxn target="emphasis" document="m9000">emphasis</cnxn>, or <cnxn target="media" document="m9006">media</cnxn>.
	</para>
      </section>

      <section id="using">
	<name>Using CALS Tables</name>
	<para id="tablep3">
	  It might sound a little confusing but I think that the best
	  way to understand a table is to look at <cnxn target="tableexam"/>.  For more information, consult the
	  <link src="http://www.oasis-open.org/specs/a502.htm">CALS
	  Table Spec</link> or the <link src="http://cnx.rice.edu/technology/cnxml/0.5/spec">CNXML
	  Spec</link>.
	</para>
	<example id="tableexam">
	  <code type="block">
	    <![CDATA[
<table id='grilltemp' frame='all'>
  <name>Steak Cooking Temperatures</name>
  <tgroup cols='2' colsep='1' rowsep='1'>
    <thead>
      <row>
        <entry>Temperature (&deg;F)</entry>
        <entry>Description</entry>
      </row>
    </thead>
    <tbody>
      <row>
        <entry align='center'>140</entry>
        <entry align='center'>Rare</entry>
      </row>
      <row>
        <entry align='center'>150</entry>
        <entry align='center'>Medium Rare</entry>
      </row> 
      <row>
        <entry align='center'>160</entry>
        <entry align='center'>Medium</entry>
      </row>
      <row>
        <entry align='center'>165</entry>
        <entry align='center'>Medium Well</entry>
      </row>
      <row>
        <entry align='center'>170</entry>
        <entry align='center'>Well</entry>
      </row>
    </tbody>
  </tgroup>
</table>
	    ]]>
	  </code>
	  <table id="grilltemp" frame="all">
	    <name>Steak Cooking Temperatures</name>
	    <tgroup cols="2" colsep="1" rowsep="1">
	      <thead>
		<row>
		  <entry>Temperature (°F)</entry>
		  <entry>Description</entry>
		</row>
	      </thead>
	      <tbody>
		<row>
		  <entry align="center">140</entry>
		  <entry align="center">Rare</entry>
		</row>
		<row>
		  <entry align="center">150</entry>
		  <entry align="center">Medium Rare</entry>
		</row> 
		<row>
		  <entry align="center">160</entry>
		  <entry align="center">Medium</entry>
		</row>
		<row>
		  <entry align="center">165</entry>
		  <entry align="center">Medium Well</entry>
		</row>
		<row>
		  <entry align="center">170</entry>
		  <entry align="center">Well</entry>
		</row>
	      </tbody>
	    </tgroup>
	  </table>
	</example>
      </section>
    </section>
  
    <section id="fin">
      <name>Conclusions</name>
      <para id="end">
	This concludes the CNXML tutorial.  Two useful resources are
	<link src="http://cnx.rice.edu/technology/cnxml/0.5/spec">The
	CNXML Language Spec</link> and <cnxn document="m10281">the
	example document</cnxn> we've constructed over the three part
	course in CNXML.
      </para>
    </section>
  </content>
</document>
