XML is a syntax. HTML is a vocabulary.
XML is:
The source document.
<?xml version="1.0" encoding="UTF-8"?> <article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"> <title>A Sample Document</title> <section> <title>Some Mathematics</title> <para>Here is an unknown equation: <equation> <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" display="block"> <mml:semantics> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold">a</mml:mi> <mml:mo>=</mml:mo> <mml:mfrac> <mml:mrow> <mml:mi mathvariant="bold">F</mml:mi> </mml:mrow> <mml:mi>m</mml:mi> </mml:mfrac> <mml:mo>=</mml:mo> <mml:mfrac> <mml:mrow> <mml:mi>q</mml:mi> <mml:mo>[</mml:mo> <mml:mi mathvariant="bold">E</mml:mi> <mml:mo>+</mml:mo> <mml:mfenced> <mml:mrow> <mml:mi mathvariant="bold">v</mml:mi> <mml:mi>X</mml:mi> <mml:mi mathvariant="bold">B</mml:mi> </mml:mrow> </mml:mfenced> <mml:mo>]</mml:mo> </mml:mrow> <mml:mi>m</mml:mi> </mml:mfrac> </mml:mrow> </mml:mrow> </mml:semantics> </mml:math> </equation> </para> </sect1> </article>
An extract from the US State Department
<text> <front> <titlePage type="main"> <pb n="I" xml:id="pg_I" facs="0001"/> <figure> <graphic url="figure_0001.tif"/> </figure> <docTitle> <titlePart type="series">Foreign Relations of the United States</titlePart> <titlePart type="subseries">1945–1950</titlePart> <titlePart type="volume">Emergence of the Intelligence Establishment</titlePart> </docTitle> <docImprint>Department of State<lb/>Washington, DC</docImprint> <byline>Editor: <persName>C. Thomas Thorne, Jr.</persName> <lb/> <persName>David S. Patterson</persName> </byline> <byline>General Editor: <persName>Glenn W. LaFantasie</persName> </byline> <docImprint> <publisher>United States Government Printing Office</publisher> <pubPlace>Washington</pubPlace> <pb n="II" xml:id="pg_II" facs="0002"/> <docDate>1996</docDate>DEPARTMENT OF STATE PUBLICATION 10316<lb/>OFFICE OF THE HISTORIAN<lb/>BUREAU OF PUBLIC AFFAIRS<lb/>For sale by the U.S. Government Printing Office Superintendent of Documents, Mail Stop: SSOP, Washington, DC 20402-9328<lb/>ISBN 0-16-045208-2</docImprint> </titlePage> <pb n="III" xml:id="pg_III" facs="0003"/> <div type="section" xml:id="preface"> <head>Preface</head> <p>The <hi rend="italic">Foreign Relations</hi> of the United States series presents the official documentary historical record of major foreign policy decisions and significant diplomatic activity of the United States Government. The series documents the facts and events that contributed to the formulation of policies and includes evidence of supporting and alternative views to the policy positions ultimately adopted.</p>
Purpose: to differentiate your use of names from mine.
Is
address
a street location or a computer IP address?
Names are declared via attributes:
<doc xmlns="http://example.com/doc" xmlns:m="http://www.w3.org/1998/Math/MathML"/>
Declaration are scoped to the descendants:
<doc xmlns="http://example.com/doc" xmlns:m="http://www.w3.org/1998/Math/MathML"> <p>I'm {http://example.com/doc}p</p> <m:math>I'm {http://example.com/doc}math</m:math> <b:error>I'm broken!</b:error> </doc>
Name resolve via the ancestors:
<doc xmlns="http://example.com/doc" xmlns:m="http://www.w3.org/1998/Math/MathML"> <div xmlns:f="http://example.com/functions"> <f:function name="binomial"> <m:math> <m:apply><m:csymbol cd="relation1">eq</m:csymbol> <m:apply><m:csymbol cd="combinat1">binomial</m:csymbol><m:cn>4</m:cn><m:cn>2</m:cn></m:apply> <m:cn>6</m:cn> </m:apply> </m:math> </f:function> </div> </doc>
Answer #1: It did. You just don't see it.
Answer #2: It isn't an intrinsic vocabulary. It's a syntax.
Answer #3: Web browsers don't do the same thing with XML documents as they do with HTML.
When the browser loads an XML document:
The result is applications do not work well.
This can be fixed: