Skip to content Skip to navigation

Connexions

You are here: Home » Content » The Advanced CNXML

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual Connexions member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.

Also in these lenses

  • SHN CNX Workshop display tagshide tags

    This module is included inLens: Stategic Horizon Network Workshop on Alternative Couseware -- Connexions Session
    By: ConnexionsAs a part of collection:"Connexions Tutorial and Reference"

    Comments:

    "If you are ready to start creating new materials in Connexions, or adapting and reusing existing materials, this guide and tutorial will help you get started. Questions are always welcome to […]"

    Click the "SHN CNX Workshop" link to see all content selected in this lens.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

The Advanced CNXML

Module by: Ricardo Radaelli-Sanchez, Connexions. E-mail the authors

User rating (How does the rating system work?)
Ratings

Ratings allow you to judge the quality of modules. If other users have ranked the module then its average rating is displayed below. Ratings are calculated on a scale from one star (Poor) to five stars (Excellent).

How to rate a module

Hover over the star that corresponds to the rating you wish to assign. Click on the star to add your rating. Your rating should be based on the quality of the content. You must have an account and be logged in to rate content.

:
(0 ratings)

Summary: 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.

Code

The 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 CNXML Spec. The code tag has a display attribute with two possible values.

  • inline (default) - used to specify code that is inline.
  • block - used to specify code that should be in a separate block of text.

Example 1


<para id='copy'>
  In a unix terminal the command to copy a file is <code
  display='inline'>cp original copy</code>.
</para>
	  
	

In a unix terminal the command to copy a file is cp original copy

Exercise

The exercise tag provides a tag for authors to add practice problems into their documents. The exercise tag has a required id attribute and has two child tags, problem and solution.

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 QML.

Example 2


	  
<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>
	  
	

Problem 1

For food safety, a steak should be cooked to a minimum temperature of what?

Solution

160° F or until the juices run clear and the meat is no longer pink

CALS Table

CNXML uses the industry standard CALS Table Model for including tables into CNXML documents. Provided below is a brief description of the CALS tags, their attributes, and children (along with a helpful example). For a more complete description of the CALS Table consult the CALS Table Spec.

table

The table tag marks the beginning of a table. It has an optional first child of title and must contain one or more tgroup tags. The table tag also has many attributes, to find out more information consult the CALS Table Spec.

tgroup

The tgroup tag marks the beginning of a new portion of a table. It has a required attribute cols which is the number of columns in the tgroup. Its children tags are zero, one, or more colspec or spanspec, zero or one thead or tfoot, and one tbody tag.

colspec

The colspec tag is an empty tag that specificies the column of a table or entrytbl. The names and numbers specified as attributes are used for referencing by other tags.

spanspec

The spanspec 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 entry or entrytbl in different rows.

thead

The thead tag identifies the heading row of a tgroup or entrytbl. The thead tag can have zero, one, or more colspec tags and one or more row.

tfoot

The tfoot tag identifies the rows of footer information that are displayed after the tbody. The tfoot tag can have zero, one, or more colspec tags and one or more row.

tbody

The tbody tag identifies the body of a tgroup or entrytbl. The tbody tag must have one or more row tags.

row

The row tag identifies the row of information in a thead, tbody, or tfoot. The row tag must have one or more entry or entrytbl.

entrytbl

The entrytbl tag takes the place of an entry, but fits into a single row of tbody in a tgroup. The content model is the same as that of a tgroup except that tfoot is ommitted and entrytbl is self-excluding. Its children tags are zero, one, or more colspec or spanspec, zero or one thead or tfoot, and one tbody tag.

entry

The entry tag identifies an entry in a row. The entry tag contains ASCII text and zero, one, or many cite, term, cnxn, link, code, emphasis, or media.

Using CALS Tables

It might sound a little confusing but I think that the best way to understand a table is to look at Example 3. For more information, consult the CALS Table Spec or the CNXML Spec.

Example 3


<table id='grilltemp' frame='all'>
  <title>Steak Cooking Temperatures</title>
  <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>
	    
	  
Table 1: Steak Cooking Temperatures
Temperature (°F) Description
140 Rare
150 Medium Rare
160 Medium
165 Medium Well
170 Well

Conclusions

This concludes the CNXML tutorial.

Content actions

Give Feedback:

E-mail the module authors | Rate module ( How does the rating system work?)

Rating system

Ratings

Ratings allow you to judge the quality of modules. If other users have ranked the module then its average rating is displayed below. Ratings are calculated on a scale from one star (Poor) to five stars (Excellent).

How to rate a module

Hover over the star that corresponds to the rating you wish to assign. Click on the star to add your rating. Your rating should be based on the quality of the content. You must have an account and be logged in to rate content.

(0 ratings)

Download:

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.

| A lens (?)

Definition of a lens

Lenses

A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual Connexions member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks