Wiley Professional ASP.NET 2.0 XML 978-0-7645-9677-3 사용자 설명서

제품 코드
978-0-7645-9677-3
다운로드
페이지 22
This chapter is about XML as a language and its related technologies. A comprehensive treatment of
the subject could easily fill 300 pages or more, so this chapter attempts to strike a reasonable balance
between detail and succinctness. In the pages that follow, you learn about the different XML-related
technologies and their usage. But before that, take a brief look at XML itself.
A Primer on XML
XML is derived from the Standard Generalized Markup Language (SGML), a rich language used mostly
for huge documentation projects. The designers of XML drew heavily from SGML and were guided by
the lessons learned from HTML. They produced a specification that was only about 20 percent the size
of the SGML specification, but nearly as powerful. Although SGML is typically used by those who need
the power of an industrial-strength language, XML is intended for everyone.
One of the great strengths of XML is the extensibility it brings to the table. XML doesn’t have any tags of its
own and it doesn’t constrain you like other markup languages. Instead, XML defines rules for developing
semantic tags of your own. The tags you create form vocabularies that can be used to structure data into
hierarchical trees of information. You can think of XML as a metamarkup language that enables developers,
companies, and even industries to create their own, specific markup languages.
One of the most important concepts to grasp in XML is about content, not presentation. The tags you 
create focus on organizing your data rather than displaying it. XML isn’t used, for example, to indicate a
particular part of a document in a new paragraph or that another part should be bolded. XML is used to
develop tags that indicate a particular piece of data is the author’s first name, another piece is the book
title, and a third piece is the published year of the book.
Self-Describing Data
As mentioned before, the most powerful feature of XML is that it doesn’t define any tags. Creating your
own tags is what makes XML extensible; however, defining meaningful tags is up to you. When creating
tags, it isn’t necessary to abbreviate or shorten your tag names. It doesn’t make processing them any
faster. but it can make your XML documents more confusing or easier to understand. Remember, devel-
opers are going to be writing code against your XML documents. On the one hand, you could certainly
define tags like the following:
<H1>XSLT Programmers Reference
<p><b>Michael Kay</b></p>
</H1>
Using these HTML-based tags might make it easy to be displayed in a browser, but they don’t add any
information to the document. Remember, XML is focused on content, not presentation. Creating the 
following XML would be far more meaningful:
<books>
<book>
<title>XSLT Programmers Reference</title>
<author>Michael Kay</author>
</book>
</books>
2
Chapter 1
04_596772 ch01.qxd  12/13/05  11:17 PM  Page 2