![]() | ||
| ||
![]() |
XML is flexible and technically can have subset vocabularies built on top of standard XML syntax and structure. What this allows is for standard practices to be set for a particular industry, discipline, or application. And these different vocabularies are all based on XML syntax, which as you already know is more or less platform independent and universally usable, by anyone . Building of these vocabularies is very similar to the way in which specialized classes are built from more abstracted classes, in an object modeling environment.
In general, vocabularies can be divided into two main groups:
Application-specific XML vocabularies, which are shared across multiple industries and disciplines
Industry-specific XML vocabularies, perhaps shared by different applications within the same industry
As you can see in Figure 14-1, there are a multitude of different XML vocabularies, applying to specific types of applications and specific industries.
Further details on vocabularies shown in Figure 14-1 can be found at www.service-architecture.com .
Lets pick one of the vocabularies shown in Figure 14-1. The MathML (or Mathematics XML) seems like a sensible choice, given the material presented in this book. Even though the topic of mathematics can seem incredibly complex in some ways, the interpretation of mathematical formulae and calculations, expressed in XML, can be very simple. In other words, you dont have to understand the meanings of mathematical formulae to write them out in XML, using MathML. As opposed to being written down in English, or some otherwise abstract scientific notation, formulae are recorded as XML. One does not have to have much of an understanding of the content and semantics of a mathematical formula. Each part of a formula has a specific tag in MathML and can thus be easily converted. Some of the elements of MathML are shown in Figure 14-2.
Figure 14-2 shows some of the Mathematics XML elements as listed on the W3C specification website for MathML. The elements important to your understanding in this book are as shown in Figure 14-3.
The topics of this book are XML and databases, not mathematics. This why many of the items in Figure 14-2 are grayed out, and also why only a small number of all the elements in MathML are covered here. I am simply trying to demonstrate a vocabulary for specific tasks in this case, mathematics! Figure 14-3 shows the basic elements that make up MathML. Heres an example:
x + y
The preceding expression can be represented in MathML with the following steps. First, you need the namespace and the root element:
<math xmlns="http://www.w3.org/1998/Math/MathML"> </math>
Next, you group the expression as an executable expression, which is not operated on with any other expression, or part thereof, at this level of precedence:
<math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> </mrow> </math>
Now you add the first variable, x :
<math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi> x </mi> </mrow> </math>
Then you add the second variable, y :
<math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi> x </mi> <mi> y </mi> </mrow> </math>
And finally, you add the operator between the two variables , yielding the entire expression:
<math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> </mrow> </math>
This makes sense. All you are seeing here is that a specialized syntax of XML is being used to interpret a specialized topic or language. In this case, you are attempting to write mathematical expressions into XML, using a specialized form of XML called MathML. The resulting MathML XML documents can be passed between many different mathematicians, and even computers, and be universally understandable by all (persons and computers). It certainly beats writing complex, mile-long equations down on paper, scanning them, e-mailing the images, and then expecting some mathematician on the other side of the world to read your writing, let alone interpret the symbols. And computer imaging? Not a chance. Still in the realm of science fiction at this level. And even if possible, much more expensive to implement. Mathematicians generally use a common system of symbols. Industry standards will likely vary. XML standards can certainly help. And if there are not any tools for constructing vocabulary-specific XML documents, then they will likely be built if someone is willing to pay for them. And there are always many people willing to build open source software.
As already stated ad infinitum throughout this book, the intention of this book is beginner level, and not to go into too much depth with something, such as describing the ins and outs of MathML. So, lets get away from the more technical coding aspects and look at some simple examples on the Internet. What about a news feed? This could be written in XML, with a specific XML vocabulary for news feeds. Figure 14-4 shows a website containing medical information news feeds.
I clicked the first XML link, as shown in Figure 14-4, and got the result shown in Figure 14-5. You may get an error from clicking this link, depending on which browser and operating system you are using.
Figure 14-5 demonstrates an XML vocabulary that is universally understandable to a specific industry namely, the medical news media. This specific vocabulary is a thing called RSS 0.91. RSS is actually a family of XML formats called Rich Site Summary (also known as Really Simple Syndication). RSS allows construction of XML in a specialized manner. RSS yields richly formatted and interpretable XML content for a specific application or industry. RSS is often used for news feeds on the Internet.
Another, perhaps more fun example might be one called Astronomy Instrument Markup Language (AIML). AIML can be used to denote the way in which astronomical instruments are managed. This includes instruments such as telescopes, cameras (of any form one can dream up), and any other type of weird and wonderful instrument that might be used for finding stuff in outer space, from outer space, on land, and by civilian, military, or even more secretive organizations. Figure 14-6 shows an example NASA web page.
I then clicked in the example, as shown in Figure 14-6. I got an error because the DTD file is non-existent (even with the suggested change shown in Figure 14-6). So, I downloaded the XML document indicated by the link highlighted in Figure 14-6, commented out the DTD file specification in the XML file, and executed in my Internet Explorer, as shown in Figure 14-7.
![]() | ||
| ||
![]() |