Online
 
Thursday, 20 November 2008
 
 

XML - On Mathematics Markup Language | Print |  E-Mail
 

The Mathematics Markup Language (MathML) encodes equations. A well-known equation among physicists is Newton's Law of Gravitation: F = GMm / r2.

Example:

<?xml version="1.0"?>

<math xmlns="http://www.w3.org/1998/Math/MathML">

  <mi>F</mi>

  <mo>=</mo>

  <mi>G</mi>

  <mo>&InvisibleTimes;</mo>

  <mfrac>

    <mrow>

      <mi>M</mi>

      <mo>&InvisibleTimes;</mo>

      <mi>m</mi>

    </mrow>

    <apply>

      <power/>

      <ci>r</ci>

      <cn>2</cn>

    </apply>

  </mfrac>

</math>

While one application might use this input to display the equation, another might use it to solve the equation with a series of values. That's a sign of XML's power.

You can also store graphics in XML documents. The Scalable Vector Graphics (SVG) language is used to draw resizable line art.

Example of SVG document

<?xml version="1.0" standalone="no"?>

<!DOCTYPE svg

   PUBLIC "-//W3C//DTD SVG 20001102//EN"

   "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">

<svg>

  <desc>Three shapes</desc>

  <rect fill="green" x="1cm" y="1cm" width="3cm" height="3cm"/>

  <circle fill="red" cx="3cm" cy="2cm" r="4cm"/>

  <polygon fill="blue" points="110,160 50,300 180,290"/>

</svg>

It's also worth noting that a document is not necessarily the same as a file. A file is a package of data treated as a contiguous unit by the computer's operating system. This is called a physical structure. An XML document can exist in one file or in many files, some of which may be on another system. It may not be in a file at all, but generated in a stream from a program. XML uses special markup to integrate the contents of different files to create a single entity, which we describe as a logical structure. By keeping a document independent of the restrictions of a file, XML facilitates a linked web of document parts which can reside anywhere.

That's XML markup in a nutshell. The whole of the next chapter is devoted to this topic. There, we'll go into deeper detail about the picky rules and describe some new components you haven't seen yet. You'll then be able to tear apart any XML document and know what all the pieces are for, and put together documents of your own.

 

 

This entry was posted on . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a comment.
Users' Comments (0)

Comment an article
  Name
  E-mail
   Title
Available characters: 4000
 Notify me of follow-up comments
This image contains a scrambled text, it is using a combination of colors, font size, background, angle in order to disallow computer to automate reading. You will have to reproduce it to post on my homepage
Enter what you see:

No comment posted

Jumbo Coklat
 
Top! Top!