# Connexions

You are here: Home » Content » The Advanced CNXML

### Lenses

What is a lens?

#### Definition of a lens

##### Lenses

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

##### What is in a lens?

Lens makers point to 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 member, a community, or a respected organization.

##### What are tags?

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

#### 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.
• CNX Documentation

This module is included inLens: Connexions Documentation
By: Connexions

Click the "CNX Documentation" link to see all content affiliated with them.

Click the 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.

Module by: Ricardo Radaelli-Sanchez. E-mail the author

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

Note: You are viewing an old version of this document. The latest version is available here.

## 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 type 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
type='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. The problem tag and the solution tag have no attributes.

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

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'>
<name>Steak Cooking Temperatures</name>
<tgroup cols='2' colsep='1' rowsep='1'>
<row>
<entry>Temperature (&deg;F)</entry>
<entry>Description</entry>
</row>
<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. Two useful resources are The CNXML Language Spec and the example document we've constructed over the three part course in CNXML.

## Content actions

### Give feedback:

My Favorites (?)

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

| A lens I own (?)

#### Definition of a lens

##### Lenses

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

##### What is in a lens?

Lens makers point to 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 member, a community, or a respected organization.

##### What are tags?

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