<< Chapter < Page Chapter >> Page >
This is a basic introduction to the CNXML language. It includes a description on how to begin a CNXML module and also examples of the basic tags needed to start writing in CNXML.

Starting with cnxml

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!

Cnxml tags

Document

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:

    Document (root tag)

  • Title
  • Metadata Section
  • Content Section

The document tag has one required attribute:

  • id - a unique ID given to the document.
This is automatically assigned.

Id requirements

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:

  • document
  • para
  • equation
  • list
  • rule
  • definition
  • exercise
  • table
  • div
  • section
  • subfigure
  • example
  • footnote
  • problem
  • solution
  • block quotes
  • media
  • meaning
  • proof
  • list
  • preformat
  • block code
  • figure
  • block notes
So, if you are going to use any of the above tags, be sure to add the 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>
Any tag can contain an id attribute. This is useful if you want to link to the information contained in a particular tag.

Namespaces

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">
Be aware that the you document id can not be the same as this example. Each module will have its own unique id.

Questions & Answers

what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Cnxml tutorial. OpenStax CNX. Jul 08, 2009 Download for free at http://cnx.org/content/col10121/1.10
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Cnxml tutorial' conversation and receive update notifications?

Ask