On Aug 14, 11:45*am, "Tony Johansson" <johansson.anders...@telia.com>
wrote:
Hello!
What is the reason for having xml namespace ?
I know the reason for using namespace in C# but I can't see any similarities
to Xml.
Can you just give a simple example on a Xml document where namespace will
solve the problem.
An example would be W3C XHTML+MathML+SVG profile (
http://www.w3.org/TR/
XHTMLplusMathMLplusSVG/), which allows to use all three languages in a
single document, to represent formatted text, vector graphics, and
formulas. Sample XML using that profile looks like this - note the use
of namespaces used to separate the languages:
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>XHTML as the host language</title>
</head>
<body>
... XHTML content ...
<math xmlns="http://www.w3.org/1998/Math/MathML">
... MathML content ...
</math>
... XHTML content ...
<svg:svg version="1.1"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
... SVG content ...
<svg:switch>
<svg:foreignObject ...>
<p>
... XHTML content ...
<math xmlns="http://www.w3.org/1998/Math/MathML">
... MathML content ...
</math>
... XHTML content ...
</p>
</svg:foreignObject>
</svg:switch>
</svg:svg>
</body>
</html>