Skip to content Skip to navigation

OpenStax_CNX

You are here: Home » Content » What's New in CNXML 0.6

Navigation

Recently Viewed

This feature requires Javascript to be enabled.
 

What's New in CNXML 0.6

Module by: Kyle Barnhart, Connexions. E-mail the authors

Summary: A guide to the changes made in the 0.6 version of the Connexions Markup Language (CNXML 0.6). Written with experienced authors in mind, this document features a list of new elements, new attributes, and changes made to existing elements. It also includes code examples and links to other CNXML resources.

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

Connexions Markup Language 0.6 (CNXML 0.6) was unveiled on January 29, 2009. Several changes have been made to the language, including new elements, new attributes, and new behavior. The site itself has added features to make the transition to CNXML 0.6 as easy as possible.

Connexions has compiled a list of important changes in CNXML 0.6 for the convenience of its experienced authors. There are several resources in the Connexions Documentation lens to help less familiar users get started writing their own modules in CNXML. A full list of technical changes to the CNXML language can be found on Rhaptos, Connexions' development documentation site.

A Complete List of CNXML Tags can be found here.

Upgrade Your Modules

If you have published content on Connexions before, you may be wondering if the new language has affected your modules. Existing modules will continue to function normally without any sort of upgrade or intervention. You do not need to change anything in your module or collection if it has already been published. Your readers will still be able to build collections with your modules, download PDF copies of your content, and enjoy all of the other features that Connexions offers.

However, you must upgrade your module to CNXML 0.6 before you can re-publish any existing content. Connexions has developed an easy-to-use conversion tool that takes care of this task for you without changing the look, feel, or presentation of the module.

When you checkout or import a module written in CNXML 0.5, the first thing you will notice is a notification on the Edit Text page urging you to upgrade your module. This process is safe and completely automatic. The upgrade tool creates a backup copy of your original module, saves the backup CNXML file in your module's file folder, and transforms the module from CNXML 0.5 to 0.6. The module is then ready to be edited.

You can find more information about this process on the upgrade help page.

New Elements in CNXML 0.6

Welcome to the New Media

The structure of media tags has been changed dramatically from previous versions of the CNXML language. There are now elements to handle each specific media type, from images and videos to Java applets and Labview demonstrations. This has cut down on the number of param tags necessary to display a media element. It also gives authors a straightforward way to specify alternate media in print, i.e. displaying a Flash video online and an image in the PDF. For more information on the new media tags, check out the media element in Edit-In-Place's help.

Example 1: The media element displaying an image.

<media id="dogpic" display="block"
       alt="Un perro sentado en una cama">
  <image mime-type="image/jpeg"
         src="image1.jpg" />
</media>

Example 2: The media element displaying an Adobe Flash animation.

<media id="flash-example" display="block" 
       alt="stuff">
  <flash id="exp-swf"
         mime-type="application/x-shockwave-flash" 
         src="small-flash.swf" width="382"
         height="288"/>
</media>

The Name Element Is Now Title

The name tag has been replaced by the title tag. The name tag is no longer applied to the document element; the title element has been added for that purpose.

Example 3: The title element.

<para id="cnxml">
  <title>An Introduction to CNXML</title>
  This paragraph presents a brief introduction 
  to a customized version of XML called CNXML.
</para> 

Link Is The New CNXN

The cnxn tag has been assimilated into the link tag-- after all, who needs two tags that basically do the same thing? Links to outside resources are called using the url attribute while links to internal modules use the document attribute. You can read all about these changes below, or click here for a more technical explanation of the new link tag.

Example 4: The link element.

<para id="linkexample">
  There are many ways to grill <link document="m10275" version="2.1">
    a good steak</link>.
</para>

Add Commentary to Your Exercises

The exercise tag now includes a third child element, commentary. This new tag allows you to add commentary to the end of your exercise.

Example 5: The commentary element.

<exercise id="element-472">
  <problem id="element-124">
    <para id="prob_1">
      If a golf ball and a feather were
      dropped at the same time from 10 feet,
      which would strike the ground first?
    </para>
  </problem>
  <solution id="element-1e24">
    <para id="sol_1">
      The golf ball would hit the ground first.
    </para>
  </solution>
  <commentary id="element-124s" 
    type="Follow-up">
      How would this problem have been different
      if the experiment was conducted in a vacuum?
  </commentary>
</exercise>

Draw Blanks With the Space Element

The space element gives users the ability to add blank, white space to their document. Users can now add blanks lines to their exercises without simply placing several non-breaking spaces in succession.

Example 6: The space element.

<exercise id="exercise1">
  <problem>
    <para id="exercise1a">
      Fill in the blanks: 
    </para>
    <para id="exercise1b">
      A water molecule is made up of two
      <space count="10" effect="underline" /> 
      atoms and one
      <space count="10" effect="underline" /> 
      atom.
    </para>
  </problem>
  <solution>
    <para id="solution1">
      Hydrogen, Oxygen
    </para>
  </solution>  
</exercise>

A New Element for Footnotes

Footnotes are now specified with the footnote element, rather than being notes of type="footnote".

Example 7: The footnote element.

<para id="footnote-example">
  Many people may not know that cheesecake
  is tart, not a cake. 
  <footnote id="eip-id4632830"> 
    Alan Davidson, Oxford Companion to Food,
    s.v. cheesecake: "Cheesecake, not a
    cake in the ordinary sense, is really a
    kind of tart."
  </footnote>
</para>

Superscripts and Subscripts

Superscripts and subscripts can now be defined with the sup and sub elements, respectively. Connexions still encourages users to use MathML for mathematical expressions with superscripts and subscripts.

Example 8: The sup element.

<para id="sup-example">
  We called him Rowdy Rodney, or R<sup>2</sup> for short.
</para> 

Example 9: The sub element.

<para id="sub-example">
  The second length value is sometimes noted as L<sub>2</sub> 
</para> 

Control Spacing With Preformat

If you use Connexions' full-source editor, you'll love the new preformat tag. Text contained in the preformat tag will display with the same word spacing and indentation as in full-source.

Example 10: The preformat element.

<para id="preformatexample">
This text will be displayed like normal paragraph text.
  <preformat id="examplepfmt" display="block">
This will be the next line.
  This line will be two spaces ahead of the first.
    And this line will be four!
And this line will have no spaces in front of it.
  </preformat> 
</para>

Control Your Labels

Figures, examples, sections, and any elements that use labels can now take the label element as a child. For instance, if you want to override the label "Figure 2.1" automatically applied by Connexions, you can specify one using this tag.

Example 11: The label element.

<figure id="fig1">
  <label>Figura</label>
  <media id="dogpic" display="block" 
      alt="Un perro sentado en una cama">
    <image mime-type="image/jpeg"
           src="image1.jpg" />
  </media>
  <caption>Este es mi perro Benny
    haciendo lo que hace mejor.</caption>
</figure>

Insert Multiple Lines Into Your Content

In order to give Connexions authors more control over the presentation of their content in print and online, CNXML 0.6 features the ability to insert a specific number of blank lines using the newline element.

Example 12: The newline element.

<para id="lyricsexample">
  <quote id="all-we-are">"All we
  are is dust in the wind."</quote>
  <newline />
  <cite>- Kansas</cite>
</para>

Format Your Citations With Ease

Citing your work can be painful when you draw from several sources, especially when every type of publication cites its articles differently. Luckily, Connexions has added the cite-title element which can be used in conjunction with cite to make this process easier than ever. Simply use the cite-title element to markup the title and fill in the pubtype attribute with the type of publication, and Connexions take care of the rest!

Example 13: The cite-title element.

<cite>
  <cite-title pubtype="book">A Tale of Two Cities</cite-title>
  by Charles Dickens
</cite>
is a classic novel.

Changes to Existing Elements in CNXML 0.6

There have been several changes to the CNXML language besides the addition of new elements. Many attributes that were present in CNXML 0.5 have now been removed, replaced, or assimilated into different tags altogether. In order to make this list of changes useful for Connexions authors, we have compiled a list of all tags that have been changed. Attributes are listed as either required or optional. Important changes are emphasized and all changes are listed. Also, do not forget that you can edit use Edit-In-Place's help page as a reference for all available tags while you're editing your module.

section

  • name element has been removed and replaced by the title element
  • Child elements added: label, quote (block type), preformat (block type)

para

  • cnxn element has been removed and replaced by the link element
  • name element has been removed and replaced by the title element
  • Child elements added: cite-title, sub, sup, preformat, footnote, newline, space, example

cite

  • cite-title element has been added
  • cnxn element has been removed and replaced by the link element
  • Hyperlink attributes added: window, url, document, target-id, resource, version
  • Child elements added: span, sub, sup, preformat (inline), footnote, newline, space

link

  • strength attribute has been modified to accept the following values: 1, 2, 3
  • src attribute has been removed and replaced by the url attribute
  • Hyperlink attributes added: window, url, document, target-id, resource, version
  • Child elements added: span, cite-title, sub, sup, preformat, footnote, newline, space

emphasis

  • effect attribute added with the following supported values: bold (default), italics, underline, normal, smallcaps
  • cnxn element has been removed and replaced by the link element
  • Child elements added: span, cite-title, sub, sup, preformat, footnote, newline, space

term

  • src attribute has been removed and replaced by the url attribute
  • Hyperlink attributes added: window, url, document, target-id, resource, version
  • Child elements are added: span, cite-title, sub, sup, preformat, footnote, newline, space

quote

  • src attribute has been removed and replaced by the url attribute
  • display attribute added with the following supported values: block, none, inline
    • id attribute is now required if the display attribute is set to block
  • type attribute added with the following supported values: prerequisite, sample, supplemental
  • Hyperlink attributes added: window, url, document, target-id, resource, version
  • Child elements added: span, cite-title, sub, sup, preformat, note, list, media, footnote, newline, space, definition, example, figure, table, rule, equation, exercise, para, title, label

foreign

  • src attribute has been removed and replaced by the url attribute
  • cnxn element has been removed and replaced by the link element
  • Hyperlink attributes added: window, url, document, target-id, resource, version
  • Child elements added: span, cite-title, sub, sup, preformat, footnote, newline, spac

equation

  • plain text is allowed in this element
  • id attribute is now required
  • type attribute added
  • name element has been removed and replaced by the title element
  • Child elements added: media, label

note

  • type attribute added with the following supported values: note, aside, warning, tip, important
    • type attribute cannot be footnote
  • display attribute added with the following supported values: block, none, inline
    • id attribute is now required if the display attribute is set to block
  • Child elements added: para, span, cite-title, sub, sup, preformat, note, list, media, footnote, newline, space, definition, example, figure, table, rule, equation, exercise, title, label

list

  • display attribute added with the following supported values: block, none, inline
  • type attribute is replaced by list-type
  • name element has been removed and replaced by the title element
  • list-type attribute added with the following supported values: bulleted, enumerated, labeled-item
  • mark-prefix attribute added
  • start-value attribute added
  • bullet-style attribute with the following supported values: bullet (default), open-circle, pilcrow, rpilcrow, asterisk, dash, section, none
  • item-sep attribute added (Default is ';' for inline lists only)
  • mark-suffix attribute added
  • number-style attribute added with the following supported values: arabic, upper-alpha, lower-alpha, upper-roman, lower-roman
  • Child elements added: label, title

item

  • name element has been removed
  • label element has been added
  • Child elements added: span, cite-title, sub, sup, preformat, footnote, newline, space, example, para, text

code

  • display attribute added with the following supported values: block, none, inline
    • id attribute is now required if display = block
    • caption element can be added if display = block
  • type attribute has been removed
  • cnxn element has been removed and replaced by the link element
  • optional lang attribute added
  • Child elements added: span, cite-title, sub, sup, preformat (inline), note (inline), media, footnote, newline, space, text

figure

  • name element has been removed and replaced by the title element
  • id attribute is required
  • optional type attribute added
  • Child elements added: label, title

subfigure

  • name element has been removed and replaced by the title element
  • id attribute is required
  • optional type attribute added
  • optional label element added
  • Child elements are media, code, table

caption

  • cnxn element has been removed and replaced by the link element
  • Child elements added: span, cite-title, sub, sup, preformat (inline), note (inline), media, footnote, newline, space, text

media

  • display attribute added with the following supported values: block, none, inline
  • id attribute is now required
  • required alt attribute has been added
  • longdesc element added
  • Child elements added (must have at least 1): object, image, audio, video, java-applet, flash, labview, text, download

example

  • optional type attribute added
  • optional label element added
  • optional title element added
  • Child elements added: preformat, quote

exercise

  • name element has been removed and replaced by the title element
  • optional commentary element added
  • optional print-placement attribute added with the following supported values: here, end
  • optional type attribute added
  • optional label element added

problem

  • name element has been removed and replaced by the title element
  • optional type attribute added
  • optional label element added
  • Child elements added: preformat, quote

solution

  • optional print-placement attribute added with the following supported values: here, end
  • optional title element added
  • optional type attribute added
  • optional label element added
  • Child elements added: preformat, quote

definition

  • optional type attribute added
  • optional label element added

meaning

  • cnxn element has been removed and replaced by the link element
  • type attribute has been added with the following supported values: related-term, narrower-term, broader-term, use-for, use
  • optional title element added
  • Child elements added: cite-title, label, title, sub, sup, preformat, footnote, newline, space, seealso

rule

  • type attribute has been added with the following supported values: rule, theorem, lemma, corollary, law, proposition
  • name element has been removed and replaced by the title element
  • optional label element added

statement

  • optional label element added
  • optional title element added
  • optional type attribute added
  • Child elements added: preformat, quote

proof

  • name element has been removed and replaced by the title element
  • optional label element added
  • optional type attribute added
  • Child elements added: preformat, quote

table

  • name element has been removed and replaced by the title element
  • required summary attribute added
  • optional type attribute added
  • optional label element added
  • The following attributes are now integer values: colsep, rowsep, tocentry, shortentry

tgroup

  • The following attributes are now integer values: colsep, rowsep

colspec

  • The following attributes are now integer values: colsep, rowsep

spanspec

  • The following attributes are now integer values: colsep, rowsep

row

  • rowsep attribute is now an integer

entrybl

  • The following attributes are now integer values: colsep, rowsep

entry

  • The following attributes are now integer values: colsep, rowsep
  • Child elements added: span, cite-title, sub, sup, code, preformat, note, list, footnote, newline, space, table, rule, equation, exercise

Changes to Attributes

Connexions has added and modified several common attributes in CNXML 0.6.

Identify Everything, Or We'll Do It For You

CNXML 0.6 introduces the ability to add the ID and class attributes to any element. This gives users the power to add more semantics to their document using the CNXML markup. Additionally, Connexions has introduced an automatic feature which adds IDs to items that require them.

Achieve Accessibility With Longdesc

For most images and online media, the alt attribute provides enough space to facilitate a good text alternative. However alt text is alternate text, not a full description of the object and what it conveys. In order to be truly accessible, media like charts, graphs, and interactive demonstrations require more in-depth descriptions of their content.

The longdesc attribute has been added to all media elements to facilitate this accessibility feature. The longdesc attribute contains a URL pointing to a text file, either hosted alongside your module or elsewhere on the web. That text file should contain a textual description of the media's content. The longdesc attribute is then used by accessibility utilities to provide visually impaired users with a meaningful representation of the media. You can find out more about the use of long descriptions here.

Get Inline With The Display Attribute

Several tags can now take the display attribute, which controls how an element is presented on the page. This attribute has three specific values.

  • block - Block display ends the current line and sets the contained item apart from the surrounding content.
  • inline - Inline display forces contained items to be set inside the surrounding content.
  • none - Tags set to the "none" display will only be present in the page markup. They will not be displayed online.

Navigating the New Hyperlink Attributes

There has been a major paradigm shift in the way hyperlinks work in CNXML 0.6. Rather than simply specifying a URL or a module ID for links, elements that use hyperlinks now have a variety of different attributes which control their behavior. This applies to both link and cite. Note that the cnxn tag has been assimilated into the link tag. For both link and cite, one of the following attributes must be specified to create a hyperlink.

  • url - Takes a URL and creates a link to an external URL.
  • document - Takes a module or collection ID (i.e. m9002 or col10002) and creates a link to that document.
  • version - Takes a version number and creates a link to that version of the current document.
  • targetid - Takes the CNXML ID of an element on the page and creates an internal link to that element.
  • resource - Takes the name of a resource in the document and creates an internal link to that resource.

You can learn more about the use of hyperlinks on the Edit-In-Place help page.

Jumping Out Of The Window

Hyperlinks inside your modules are no longer limited to the same window or tab. Elements that use hyperlinks can now take advantage of the window attribute, which has two supported values of window.

  • replace - Opens the link in the current window or tab.
  • new - Loads the link inside a new window or tab.

Conclusion

Check out the Edit-In-Place Tag List for a comprehensive guide to each tag and how it works. You may also refer to the Connexions Documentation Lens for more tutorials to help you get started building your own modules!

Content actions

Download module as:

Add module to:

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? tag icon

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