| XML - On Mathematics Markup Language | | Print | |
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>⁢</mo>
<mfrac>
<mrow>
<mi>M</mi>
<mo>⁢</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.
| Users' Comments (0) |
|
No comment posted






