CNXML is a lightweight XML markup language for marking up educational content. The goal of CNXML is to convey the content of the material and not a particular presentation. Connexions uses the Connexions Markup Language (CNXML) as its primary language for storing documents. Now let's get started!
Content
Now that you have the document
tag set up with an id and namespace info, the next thing to
do with your document is add content. By 'content' I mean
the text that will make up the bulk of your document.
Note:
content tag. Every CNXML
document will have one content
tag. The body of the document will be here inside the
content tag.
Structural tags are the tags which are used inside of the
content tag to give structure to
the document. These tags are discussed below.
Structure Tags
Some of the structure tags are section, para, document, and content.
We have already discussed the document and content tags, so we will proceed with a short description and examples of the other other tags listed.
Para
Text can be inserted into documents by using the para tag. Each para has a required
id which must be unique
within the document.
Example 4
<para id='intro'>
I have eaten many steaks in my life and none have been more satisfying
than the backyard-grill cooked steak. Maybe this is because of the
relaxing nature of drinking a beer, being outside, and lounging that
accompanies the grilling procedure. Maybe it is because of the aroma
of the grill and the beef perfectly seasoned to your taste. Either
way, this document shows how a good steak can be prepared.
</para>
Section
As often is the case in textbooks, chapters are divided
into smaller sections. Because it is often necessary to
segment text for better understanding and coherence,
CNXML has included a section
tag.
The section tag has one required attribute, id, and a optional first child tag,
title.
Example 5
<section id='ingredsec'>
<title>Ingredients</title>
<list> ... </list>
</section>
<section id='marinadesec'>
<title>Marinade</title>
<para id='marinate'> ... </para>
<list id='marinade'> ... </list>
<para id='tobecontinued'> ... </para>
</section>
<section id='grillingsec'>
<title>Grilling</title>
<para id='prepgrill'> ... </para>
<para id='grilling'> ... </para>
</section>
Obviously ellipses would be replaced by appropriate text.
Inline Tags
Inline tags are used to embed content and functionality inside of the structural tags. Some of the more commonly used tags are discussed below.
Emphasis
The emphasis tag is used to
emphasize text in a CNXML document where emphasis in
text would be needed or desired. It is important to
note that this refers to semantic
emphasis and not a typeface, although many stylesheets
may choose to render it visually with a different
typeface.
Example 6
<para id='intro'>
I have eaten many steaks in my life and none have been more satisfying
than the backyard-grill cooked steak. Maybe this is because of the
relaxing nature of drinking a beer, being outside, and lounging that
accompanies the grilling procedure. Maybe it is because of the aroma
of the grill and the beef <emphasis>perfectly</emphasis> seasoned to
your taste. Either way, this document shows how a good steak can be
prepared.
</para>
Term
The term tag is used to mark
words or phrases which are being defined. However, its
use is confined to either a para or definition tag. The term tag has several optional
attributes:
url- a URL specifying the source or definition of the term.window- contains the possible values "replace" which results in the associated url opening in the present window, and "new" which result in the associated url opening in a new window or tab.document- the id of another Connexions module or collection.target-id- the id of a specific element (such as a para or section) in the current or another Connexions document.resource- This reference points to a file that is associated with the term in question. The resource could be a pdf, text file, or any other supplementary resource.version- The version of a Connexions module or collection. This attribute is used in conjunction with the document attribute.id- A unique identifier, whose value must begin, with a letter and contain only letters, numbers, hyphens, underscores, colons, and/or periods (no spaces).
Example 7
<para id='marinade'>
To ensure the best flavor possible, it is necessary to marinate the
beef. A steak <term url='http://marinade.com'>marinates</term> when
left to sit in a prepared sauce, or <term>marinade</term>, where it
will absorb the flavors of the ingredients. Marinating may take as
little as 15 minutes or as long as 6 hours and should
<emphasis>always</emphasis> be done in the refrigerator and
<emphasis>not</emphasis> at room temperature.
</para>
Note
The note tag creates a note to the reader, which could be a warning, tip, etc. There are five allowed types of note: note; aside; warning; tip; important. The type of note is specified by an optional type attribute.
Example 8
<para id='intro'>
I have eaten many steaks in my life and none have been more
satisfying than the backyard-grill cooked steak. Maybe this is
because of the relaxing nature of drinking a beer, being outside,
and lounging that accompanies the grilling procedure. <note
type='warning'>Excessive drinking or fun may result in overcooked or
burned steak.</note> Maybe it is because of the aroma of the grill
and the beef <emphasis>perfectly</emphasis> seasoned to your taste.
Either way, this document shows how a good steak can be prepared.
</para>
The above markup will display as:
I have eaten many steaks in my life and none have been more satisfying than the backyard-grill cooked steak. Maybe this is because of the relaxing nature of drinking a beer, being outside, and lounging that accompanies the grilling procedure.
Warning:
Link
The link tag is
used to provide a quick link to other Connexions modules, collections or external websites. The link tag can contain the following attributes.
strength- The Strength attribute can contain the values 1, 2, or 3 (with 3 being the strongest) specifying the relevance of the link.url- a URL specifying the source or definition of the term.window- contains the possible values "replace" which results in the associated url opening in the present window, and "new" which result in the associated url opening in a new window or tab.document- the id of another Connexions module or collection.target-id- the id of a specific element (such as a para or section) in the current or another Connexions document.resource- This reference points to a file that is associated with the term in question. The resource could be a pdf, text file, or any other supplementary resource.version- The version of a Connexions module or collection. This attribute is used in conjunction with the document attribute.id- A unique identifier, whose value must begin, with a letter and contain only letters, numbers, hyphens, underscores, colons, and/or periods (no spaces).
The target and document attributes can be used
together or alone. If both are used then you will link
to a particular tag in another document. If only document is used, you will link to
another document. If only target is used, you will link to a
particular tag within the current document.
Cite
The cite tag is used to refer
to non-electronic materials within a document, primarily
containing the title of a work. Cite has several optional attributes:
url- a URL specifying the source or definition of the term.window- contains the possible values "replace" which results in the associated url opening in the present window, and "new" which result in the associated url opening in a new window or tab.document- the id of another Connexions module or collection.target-id- the id of a specific element (such as a para or section) in the current or another Connexions document.resource- This reference points to a file that is associated with the term in question. The resource could be a pdf, text file, or any other supplementary resource.version- The version of a Connexions module or collection. This attribute is used in conjunction with the document attribute.id- A unique identifier, whose value must begin, with a letter and contain only letters, numbers, hyphens, underscores, colons, and/or periods (no spaces).
Quote
The quote tag is used to
denote that some text is a direct quote from some other
source. The quote tag has a display attribute which denotes
whether the quote is inline
or block. Quote can also contain all of the attributes associated with cite.
Example 9
<para id='steakquote'>
Everyone has an opinion on how a steak should be cooked. <quote
display='inline'>"A good steak should be pink in the middle and black
on the outside."</quote> Although this may sound reasonable many
remember the words of George Washington: <quote type='block'>"In any
free country a man should have the ability to purchase a nice rare
steak."</quote>
</para>"In any free country a man should have the ability to purchase a nice rare steak."
Foreign
The foreign tag is used to
denote that a foreign word or phrase is being used. Foreign can also contain all of the attributes associated with cite.
Example 10
<para id='steakquote2'>
In many latin american countries steak is called <foreign>carne
asada</foreign>.
</para>









"The canonical how-to guide to using Connexions."