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. The Connexions Project 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 required first child tag,
name.
Example 5
<section id='ingredsec'>
<name>Ingredients</name>
<list> ... </list>
</section>
<section id='marinadesec'>
<name>Marinade</name>
<para id='marinate'> ... </para>
<list id='marinade'> ... </list>
<para id='tobecontinued'> ... </para>
</section>
<section id='grillingsec'>
<name>Grilling</name>
<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 one optional
attribute:
src- a URL specifying the source or definition of the term.
Example 7
<para id='marinade'>
To ensure the best flavor possible, it is necessary to marinate the
beef. A steak <term src='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 an "out
of line" note to the reader, which could be a warning,
point of interest, etc. 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:
CNXN and Link
The cnxn and link tags are the two tags in CNXML
used for linking to other documents. The difference in
the two tags are that cnxns are used for linking to
other documents in the Connexions system while links are
used for linking to general documents on the internet.
The cnxn tag has four
attributes
-
target- targets a specific tag -
document- targets a specific document by its ID -
version- targets a specific version of a document -
strength- designates the degree to which the linked information is related to the current document
version attribute is
optional. When not specified the cnxn will default the
link to the most current version of the document. It
may seem pointless, but it is actually quite useful. If
you specify a specific version of a document, it will
never change, meaning important parts, such as
paragraphs or figures, will not disappear without
warning.
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.
The strength attribute is
optional. It can give the reader an indication of how
related the additional information is to the current
discussion.
Example 9: CNXN Example
The cnxn tag does not have to have a description of the destination in order to be used. For example, let's say you want to link to a figure inside the page but are unsure what to name the cnxn. You could you use a cnxn similar to the one below:
<cnxn target='figure1'/>
Figure 1
or
Reference
depending on whether or not the system was able to
find a suitable substitution.
In most cases you can use text in the cnxn to describe
the destination as in:
<cnxn target='figure1'>Steak Figure</cnxn>
The link tag, on the other
hand, has only a required src
tag which contains a URL for the target webpage.
Example 10
<para id='tobecontinued'>
I'll be adding to this document in <cnxn document='m9006' >The
Intermediate CNXML</cnxn> which focuses on more advanced CNXML tags.
For more marinades see the <link src='http://www.2eatcab.com'>Angus
Beef website</link>. Finally, a good resource is the <cite>Steak
Lover's Cookbook -- William Rice; Paperback</cite>.
</para>
The above markup will display as:
I'll be adding to this document in The Intermediate CNXML which focuses on more advanced CNXML tags. For more marinades see the Angus Beef website. Finally, a good resource is the Steak Lover's Cookbook -- William Rice; Paperback.
Cite
The cite tag is used to refer
to non-electronic materials within a document, primarily
containing the title of a work. See Example 10.
Quote
The quote tag is used to
denote that some text is a direct quote from some other
source. The quote tag has a type attribute which denotes
whether the quote is inline
or block.
Example 11
<para id='steakquote'>
Everyone has an opinion on how a steak should be cooked. <quote
type='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.
Example 12
<para id='steakquote2'>
In many latin american countries steak is called <foreign>carne
asada</foreign>.
</para>







Tutorial example module
The Intermediate CNXML
