XML Is a Meta Language

XML differs from markup languages such as HTML because XML can have any number of element type names that often are informally called tag names. This gives application languages that use XML syntax the functionality to represent data from any subject domain. Because all these XML application languages use the same syntax rules, those languages can be processed using a set of common core software tools that understand XML syntax rules, with custom tools being necessary for fewer aspects of processing. This makes possible efficiencies that facilitate data exchange between users and between applications.

A meta language can be thought of as a set of grammar rules. The application languages that follow the specified set of rules can be thought of as a vocabulary. Broadly, in the natural language domain there are sets of rules that specify how words are used with punctuation and so on. Many Western languages broadly follow similar sets of rules at that level, with uppercase initial letters to start a sentence, periods to complete a sentence, and so on. But the words used in each language, such as in English and French, are very different.

Of course, the syntax rules that apply to XML-based application languages are much more tightly defined and consistent than the situation in the natural language realm, but the principles are similar. Using this single set of XML syntax rules, you—or, often more importantly, the World Wide Web Consortium (W3C)—can define multiple languages that follow XML syntax rules precisely. This facilitates processing of code written in those languages because a generic XML processor (also called an XML parser) can parse the characters of files written in that language and can extract its logical structure and pass that logical information to another application more specific to the needs of the application language.

You Can Create Your Own Vocabulary

XML 1.0 is a set of syntax rules. You can create your own set of element type names, as you learned in the short examples earlier in this chapter.

Already the W3C has published specifications for many application languages of XML, including languages to describe the transformation of XML (XSLT, the Extensible Stylesheet Language Transformations, described in Chapters 1012), to create links among XML documents (the XML Linking Language, XLink, described in Chapter 14, “Linking in XML—XLink”), and to describe vector graphics (SVG, Scalable Vector Graphics).

The syntax rules of XML can also be used by corporations or business consortia to create XML application languages in various business or technical domains. Many business and technical domains have already created common vocabularies to assist data exchange. Common vocabularies use schemas to define the allowed content and structure of a class of XML documents. Schemas can be written using non-XML syntax— Document Type Definitions, described in Chapter 4, “Valid XML—Document Type Definitions” —or using XML syntax, the W3C XML Schema language described in Chapter 19, “Beyond DTDs—W3C XML Schema.”

This enormous flexibility of XML needs some order applied to it—after all, if everyone used element type names just as they personally wanted, individuals or companies would use different element type names to describe the same thing or would use the same element type names to describe different concepts. In fact, these problems are pretty much impossible to avoid; this potential for element name clashes led to the development of namespaces in the XML specification. Namespaces are described in Chapter 8, “Namespaces in XML.”

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset