In some cases, these applications may use the same name to refer to
different things. For example, in SVG a set
element sets the value of an attribute for a specified duration of
time, while in MathML a set element represents a
mathematical set such as the set of all positive even numbers.
It's essential to know when you're
working with a MathML set and when
you're working with an SVG set.
Otherwise, validation, rendering, indexing, and many other tasks will
get confused and fail.
Example 4-2. A list of paintings including catalog information about the list
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<catalog>
<RDF>
<Description
about="http://www.cafeconleche.org/examples/impressionists.xml">
<title> Impressionist Paintings </title>
<creator> Elliotte Rusty Harold </creator>
<description>
A list of famous impressionist paintings organized
by painter and date
</description>
<date>2000-08-22</date>
</Description>
</RDF>
<painting>
<title>Memory of the Garden at Etten</title>
<artist>Vincent Van Gogh</artist>
<date>November, 1888</date>
<description>
Two women look to the left. A third works in her garden.
</description>
</painting>
<painting>
<title>The Swing</title>
<artist>Pierre-Auguste Renoir</artist>
<date>1876</date>
<description>
A young girl on a swing. Two men and a toddler watch.
</description>
</painting>
<!-- Many more paintings... -->
</catalog>
Now we have a problem. Several elements have been overloaded with
different meanings in different parts of the document. The
title element is used for both the title of the
page and the title of a painting. The date element
is used for both the date the page was written and the date the
painting was painted. One description element
describes pages, while another describes paintings.
This presents all sorts of problems. Validation is difficult because
catalog and Dublin Core elements with the same name have different
content specifications. Web browsers may want to hide the page
description while showing the painting description, but not all
stylesheet languages can tell the difference between the two.
Processing software may understand the date format used in the Dublin
Core date element, but not the more free-form
format used in the painting date element.
We could change the names of the elements from our vocabulary,
painting_title instead of
title, date_painted instead of
date, and so on. However, this is inconvenient if
you already have a lot of documents marked up in the old version of
the vocabulary. And it may not be possible to do this in all cases,
especially if the name collisions occur not because of conflicts
between your vocabulary and a standard vocabulary, but because of
conflicts between two or more standard vocabularies. For instance,
RDF just barely avoids a collision with the Dublin Core over the
Description and description
elements.