17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 16: A Brief XML Primer<br />

So, with all that said, in this chapter we’ll look at:<br />

❑ What XML is<br />

❑ What other technologies are closely tied to XML<br />

I mentioned a bit ago that XML is usually not a good way to store data, but there are exceptions. One<br />

way that XML is being utilized for data storage is for archival purposes. XML compresses very well, and<br />

it is in a very open kind of format that will be well understood for many years to come — if not forever.<br />

Compare that to, say, just taking a <strong>SQL</strong> <strong>Server</strong> <strong>2008</strong> backup. A decade from now when you need to<br />

restore some old data to review archival information, you may very well not have a <strong>SQL</strong> <strong>Server</strong> installation<br />

that can handle such an old backup file, but odds are very strong indeed that you’ll have something<br />

around that can both decompress (assuming you used a mainstream compression library such as ZIP)<br />

and read your data. Very handy for such “deep” archives.<br />

XML Basics<br />

474<br />

There are tons and tons of books out there on XML (for example, Wrox’s Professional XML, by Evjen et<br />

al). Given how full this book already is, my first inclination was to shy away from adding too much<br />

information about XML itself, and assume that you already knew something about XML. I have, however,<br />

come to realize that even all these years after XML hit the mainstream, I continue to know an awful<br />

lot of database people who think that XML “is just some Web technology,” and, therefore, have spent<br />

zero time on it — they couldn’t be more wrong.<br />

XML is first and foremost an information technology. It is not a Web-specific technology at all. Instead, it<br />

just tends to be thought of that way (usually by people who don’t understand XML) for several reasons —<br />

such as:<br />

❑ XML is a markup language, and looks a heck of a lot like HTML to the untrained eye.<br />

❑ XML is often easily transformed into HTML. As such, it has become a popular way to keep the<br />

information part of a page, with a final transformation into HTML only on request — a separate<br />

transformation can take place based on criteria (such as what browser is asking for the<br />

information).<br />

❑ One of the first widely used products to support XML was <strong>Microsoft</strong>’s Internet Explorer.<br />

❑ The Internet is quite often used as a way to exchange information, and that’s something that<br />

XML is ideally suited for.<br />

Like HTML, XML is a text-based markup language. Indeed, they are both derived from the same original<br />

language, called SGML. SGML has been around for much longer than the Internet (at least what we<br />

think of as the Internet today), and is most often used in the printing industry or in government related<br />

documentation. Simply put, the “S” in SGML doesn’t stand for simple (for the curious, SGML stands for<br />

“standard generalized markup language”) — SGML is anything but intuitive and is actually a downright<br />

pain to learn. (I can only read about 35 percent of SGML documents that I’ve seen. I have, however, been<br />

able to achieve a full 100 percent nausea rate when reading any SGML.) XML, on the other hand, tends<br />

to be reasonably easy to decipher.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!