Connexions

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

Combining the DTDs of XML Languages

Module by: Sarah Coppin, Bill Wilson

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

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">
      

Comments, questions, feedback, criticisms?

Send feedback