<< Chapter < Page Chapter >> Page >

XML supports several encoding schemes

XML is not confined to the use of the ASCII encoding scheme. Several different encoding schemes can be used. However, all of them have been selectedto make it possible to read a raw XML document without the requirement for any special software.

What do I mean by a raw XML document?

By a raw XML document, I am referring to the string of sequential characters that makes up the document, before any specific rendering has been applied tothe document.

What do I mean by rendering?

The most common use of the word rendering in the information technology world means to present something for human consumption. Thus, we render thespecifications for a new house as a set of drawings.

When we speak of rendering a drawing or an image, we usually mean that we are going to present it in a way that makes it look like a drawing or an image to ahuman observer.

When we speak of rendering a document, we usually mean that we are going to present it in a way that a human will recognize such as a book, a newspaper, aweb page, or some other document style.

Consider a newspaper, for example

There are at least two different ways to render a newspaper. One way is to print the information (daily news) , mostly in black and white, on large sheets of low-grade paper commonly known as newsprint. This is the rendering formatthat ends up on my driveway each morning.

Render on a computer screen

Another way to render a newspaper is to present the information on a computer screen, usually in full color, with the information content trying to fight itsway through dozens of animated advertisements. This is the rendering format that ends up on my computer screen each day when I check for the news of the day.

The base information doesn't change

The base information for the newspaper doesn't (or shouldn't) change for these two renderings. After all, news is news and the content of the newsshouldn't depend on how it is presented. What does change is the manner in which that information is presented.

A newspaper is a structured document

A newspaper is a structured document consisting of pages, columns, etc. When the information content of a newspaper is created and maintained in XML, thatsame information content can be rendered either on newsprint paper or on your computer screen without having to rewrite the information content.

Achieving Structure

Consider the simple structure shown in Figure 1 that represents a book having two chapters with some text in each chapter:

Figure 1 . The structure of a simple book.
Begin Book Begin Chapter 1Text for Chapter 1 End Chapter 1Begin Chapter 2Text for Chapter 2 End Chapter 2End Book

Obviously a real book has a lot more structure than this, such as the preface, the table of contents, paragraphs in the text, and an alphabeticalindex. However, I am trying to keep this example as simple as possible.

The Objective of XML

Perhaps the primary reason for using XML is to make it possible to share the same physical document among different computer systems in a way that they allunderstand.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Introduction to xml. OpenStax CNX. Dec 02, 2014 Download for free at https://legacy.cnx.org/content/col11207/1.18
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Introduction to xml' conversation and receive update notifications?

Ask