<< Chapter < Page | Chapter >> Page > |
CNXML is a lightweight XML markup language for marking up educational content. The goal of CNXML is to conveythe 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!
All CNXML documents have as their root the
document
tag. Everything about the
document including it's metadata and content are containedwithin the document tag. It is important that you understand
the basic structure for a CNXML document. The structure isas follows:
The document tag has one required attribute:
id
- a unique ID given to the
document.One major difference between CNXML and other markup
languages is the
id
attribute
requirement. Certain tags require that you include the
id
attribute, but all can possess an
id
. The tags requiring an id are listed
below:
id
attribute and
give it a unique 'id'. Be aware that in CNXML 0.6 ids will be generated automatically, but you are still permitted to specify you own ids if you wish.
Here is an example of a couple of paras containing a user generated ids.
<para id='uniqueid1'>This is an example to illustrate the use of the<code>id</code>attribute.</para><para id='uniqueid2'>This paragraph has a different id than the last.</para>
id
attribute. This is useful if you want to link to the
information contained in a particular tag.The
document
tag should also
contain any
namespace declarations.
Namespaces allow us to easily use
other mark-up languages within CNXML without having toworry about whether tag name collision will occur. For
simple documents using only CNXML, you need to include theCNXML namespace attribute
. Any
additional languages need to be declared as well andshould be given their own prefixes. For example, to
associate the MathML namespace with the prefix "m",include the following attribute:
xmlns:m='http://www.w3.org/1998/Math/MathML'
.
This states that any tag with a prepended "m" will beinterpreted as a MathML tag while any tag without a prefix
will be interpreted as CNXML. The document tag should also contain the metadata namespace
xmlns:md="http://cnx.rice.edu/mdml/0.4"
, the bibtex namspace
xmlns:bib="http://bibtexml.sf.net/"
, and the question markup language
xmlns:q="http://cnx.rice.edu/qml/1.0"
.
This what the document tag should look like.
<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="m9000" module-id="" cnxml-version="0.6">
Notification Switch
Would you like to follow the 'Connexions tutorial and reference' conversation and receive update notifications?