Skip to content Skip to navigation

OpenStax-CNX

You are here: Home » Content » Combining the DTDs of XML Languages

Navigation

Recently Viewed

This feature requires Javascript to be enabled.
 

Combining the DTDs of XML Languages

Module by: Sarah Coppin, Bill Wilson, Connexions. E-mail the authors

Summary: Explains how to include more than one XML language within the same document.

Warning:

This module contains Connexions documentation which is out-of-date. The contents of this module are provided here for historical purposes only and should not be considered accurate for the current version of the Connexions website. Please visit the help page for up-to-date information about the Connexions website, including support for viewing and authoring content and the CNXML language. If you have any additional questions or cannot find the answer to your question, please contact techsupport@cnx.org and we will be happy to assist in any way we can.

Multiple XML languages can be combined in the same document. However, in order for these documents to be valid, they must have a Document Type Definition (DTD) that allows tags from one language to exist inside tags from another language. So if you wanted to include MathML in a CNXML document, you would need a DTD that allowed MathML to exist inside certain CNXML tags. Once that DTD existed, you would declare the DOCTYPE the same as normal. To actually use both languages you would need to use namespaces.

Example 1

For just CNXML, the doctype declaration is:


    <!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" 
              "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_plain.dtd">
      

For CNXML and MathML, the doctype declaration is:


    <!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" 
              "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">
      

For CNXML and QML, the doctype declaration is:


    <!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus QML//EN" 
              "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_qml.dtd">
      

For CNXML, QML, and MathML, the doctype declaration is:


    <!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus
              MathML plus QML//EN" 
              "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml_qml.dtd">
      

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