<?xml version="1.0" encoding="utf-8"?>
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" xmlns:q="http://cnx.rice.edu/qml/1.0" id="m9007" module-id="" cnxml-version="0.6">

  <title>The Advanced CNXML</title>

  <metadata xmlns:md="http://cnx.rice.edu/mdml/0.4">
  <!-- WARNING! The 'metadata' section is read only. Do not edit below.
       Changes to the metadata section in the source will not be saved. -->
  <md:content-id>m9007</md:content-id>
  <md:title>The Advanced CNXML</md:title>
  <md:version>2.24</md:version>
  <md:created>2001/02/02</md:created>
  <md:revised>2009/04/10 14:04:29.773 GMT-5</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:fullname>Ricardo Radaelli-Sanchez</md:fullname>
        <md:email>ricky@alumni.rice.edu</md:email>
    </md:author>
    <md:author id="cnxorg">
        <md:firstname/>
        <md:surname>Connexions</md:surname>
        <md:fullname>Connexions</md:fullname>
        <md:email>cnx@cnx.org</md:email>
    </md:author>
  </md:authorlist>
  <md:maintainerlist>
    <md:maintainer id="cnxorg">
        <md:firstname/>
        <md:surname>Connexions</md:surname>
        <md:fullname>Connexions</md:fullname>
        <md:email>cnx@cnx.org</md:email>
    </md:maintainer>
    <md:maintainer id="selc">
        <md:firstname>Sarah</md:firstname>
        <md:surname>Coppin</md:surname>
        <md:fullname>Sarah Coppin</md:fullname>
        <md:email>coppin@alumni.rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="mizar">
        <md:firstname>Christine</md:firstname>
        <md:surname>Donica</md:surname>
        <md:fullname>Christine Donica</md:fullname>
        <md:email>mizar@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:fullname>Jenn Drummond</md:fullname>
        <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:fullname>Brent Hendricks</md:fullname>
        <md:email>brentmh@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  <md:license href="http://creativecommons.org/licenses/by/1.0"/>
  <md:licensorlist>
    <md:licensor id="rars">
        <md:firstname>Ricardo</md:firstname>
        <md:othername>Anthony</md:othername>
        <md:surname>Radaelli-Sanchez</md:surname>
        <md:fullname>Ricardo Radaelli-Sanchez</md:fullname>
        <md:email>ricky@alumni.rice.edu</md:email>
    </md:licensor>
  </md:licensorlist>
  <md:keywordlist>
    <md:keyword>categories</md:keyword>
    <md:keyword>category</md:keyword>
    <md:keyword>definition</md:keyword>
    <md:keyword>elem</md:keyword>
    <md:keyword>example</md:keyword>
    <md:keyword>exercise</md:keyword>
    <md:keyword>group</md:keyword>
    <md:keyword>meaning</md:keyword>
    <md:keyword>problem</md:keyword>
    <md:keyword>proof</md:keyword>
    <md:keyword>rule</md:keyword>
    <md:keyword>solution</md:keyword>
    <md:keyword>statement</md:keyword>
    <md:keyword>table</md:keyword>
    <md:keyword>term</md:keyword>
  </md:keywordlist>
  <md:subjectlist>
    <md:subject>Science and Technology</md:subject>
  </md:subjectlist>
  <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 language, CNXML 0.6.  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>
  <md:language>en</md:language>
  <!-- WARNING! The 'metadata' section is read only. Do not edit above.
       Changes to the metadata section in the source will not be saved. -->
</metadata>

<content>
    <section id="code">
      <title>Code</title>
      <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 url="http://cnx.rice.edu/technology/cnxml/0.5/spec">CNXML
	Spec</link>. The <code>code</code> tag has a <code>display</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 id="id21566845" display="block">
&lt;para id='copy'&gt;
  In a unix terminal the command to copy a file is &lt;code
  display='inline'&gt;cp original copy&lt;/code&gt;.
&lt;/para&gt;
	  
	</code>
	<para id="copy">
	  In a unix terminal the command to copy a file is <code display="inline">cp original copy</code>
	</para>
      </example>
    </section>

    <section id="exercise">
      <title>Exercise</title>
      <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>.  
      </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 url="http://cnx.rice.edu/qml/intro/qml.xml">QML</link>.
      </para>
      <example id="exerexam">
	<code id="id21437243" display="block">
	  
&lt;exercise id='grilltest'&gt;
  &lt;problem&gt;
    &lt;para id='grilltestp1'&gt;
      For food safety, a steak should be cooked to a minimum
      temperature of what?
    &lt;/para&gt;
  &lt;/problem&gt;
  &lt;solution&gt;
    &lt;para id='sol1p1'&gt;
      160&amp;deg; F or until the juices run clear and the meat is no
      longer pink.
    &lt;/para&gt;
  &lt;/solution&gt;
&lt;/exercise&gt;
	  
	</code>
	<exercise id="grilltest">
	  <problem id="id16879564">
	    <para id="grilltestp1">
	      For food safety, a steak should be cooked to a minimum
	      temperature of what?
	    </para>
	  </problem>
	  <solution id="id21438696">
	    <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">
      <title>CALS Table</title>
      <para id="calsp1">
	CNXML uses the industry standard <link url="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 <link target-id="grilltemp" class="cnxn">a helpful example</link>).  For a more
	  complete description of the CALS Table consult the <link url="http://www.oasis-open.org/specs/a502.htm">CALS Table
	  Spec</link>.
      </para>

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

      <section id="tgroupsec">
	<title>tgroup</title>
	<para id="tgroup">
	  The <code>tgroup</code> tag marks the beginning of a new
	  portion of a <link target-id="table" class="cnxn">table</link>.  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 <link target-id="colspec" class="cnxn">colspec</link> or
	  <link target-id="spanspec" class="cnxn">spanspec</link>, zero or one <link target-id="thead" class="cnxn">thead</link> or <link target-id="tfoot" class="cnxn">tfoot</link>, and one <link target-id="tbody" class="cnxn">tbody</link> tag.
	</para>
      </section>

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

      <section id="spanspecsec">
	<title>spanspec</title>
	<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 <link target-id="entry" class="cnxn">entry</link> or <link target-id="entrytbl" class="cnxn">entrytbl</link> in different <link target-id="row" class="cnxn">rows</link>.
	</para>
      </section>

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

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

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

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

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

      <section id="using">
	<title>Using CALS Tables</title>
	<para id="tablep3">
	  It might sound a little confusing but I think that the best
	  way to understand a table is to look at <link target-id="tableexam" class="cnxn"/>.  For more information, consult the
	  <link url="http://www.oasis-open.org/specs/a502.htm">CALS
	  Table Spec</link> or the <link url="http://cnx.rice.edu/technology/cnxml/0.5/spec">CNXML
	  Spec</link>.
	</para>
	<example id="tableexam">
	  <code id="id21511175" display="block">
&lt;table id='grilltemp' frame='all'&gt;
  &lt;title&gt;Steak Cooking Temperatures&lt;/title&gt;
  &lt;tgroup cols='2' colsep='1' rowsep='1'&gt;
    &lt;thead&gt;
      &lt;row&gt;
        &lt;entry&gt;Temperature (&amp;deg;F)&lt;/entry&gt;
        &lt;entry&gt;Description&lt;/entry&gt;
      &lt;/row&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;row&gt;
        &lt;entry align='center'&gt;140&lt;/entry&gt;
        &lt;entry align='center'&gt;Rare&lt;/entry&gt;
      &lt;/row&gt;
      &lt;row&gt;
        &lt;entry align='center'&gt;150&lt;/entry&gt;
        &lt;entry align='center'&gt;Medium Rare&lt;/entry&gt;
      &lt;/row&gt; 
      &lt;row&gt;
        &lt;entry align='center'&gt;160&lt;/entry&gt;
        &lt;entry align='center'&gt;Medium&lt;/entry&gt;
      &lt;/row&gt;
      &lt;row&gt;
        &lt;entry align='center'&gt;165&lt;/entry&gt;
        &lt;entry align='center'&gt;Medium Well&lt;/entry&gt;
      &lt;/row&gt;
      &lt;row&gt;
        &lt;entry align='center'&gt;170&lt;/entry&gt;
        &lt;entry align='center'&gt;Well&lt;/entry&gt;
      &lt;/row&gt;
    &lt;/tbody&gt;
  &lt;/tgroup&gt;
&lt;/table&gt;
	    
	  </code>
	  <table id="grilltemp" frame="all" summary="">
	    <title>Steak Cooking Temperatures</title>
	    <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">
      <title>Conclusions</title>
      <para id="end">This concludes the CNXML tutorial.</para>
    </section>
  </content>
</document>
