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

제품 코드
978-0-7645-9677-3
다운로드
페이지 22
The second example is far more readable in human terms, and it also provides more functionality and
versatility to nonhumans. With this set of tags, applications can easily access the book’s title or author
name without splitting any strings or searching for spaces. And, for developers writing code, searching
for the author name in an XML document becomes much more natural when the name of the element is
title, for example, rather than H1. 
Indenting the tags in the previous example was done purely for readability and certainly isn’t necessary
in your XML documents. You may find, however, when you create your own documents, indentation
helps you to read them.
To process the previous XML data, no special editors are needed to create XML documents, although a
number of them are available. And no breakthrough technology is involved. Much of the attention
swirling around XML comes from its simplicity. Specifically, interest in XML has grown because of the
way XML simplifies the tasks of the developers who employ it in their designs. Many of the tough tasks
software developers have to do again and again over the years are now much easier to accomplish. XML
also makes it easier for components to communicate with each other because it provides a standardized,
structured language recognized by the most popular platforms today. In fact, in the .NET platform,
Microsoft has demonstrated how important XML is by using it as the underpinning of the entire platform.
As you see in later chapters, .NET relies heavily on XML and SOAP (Simple Object Access Protocol) in its
framework and base services to make development easier and more efficient.
Basic Terminology
XML terminology is thrown around, sometimes recklessly, within the XML community. Understanding
this terminology will help you understand conversations about XML a little more. 
Well-Formed
A document is considered to be well-formed if it meets all the well-formedness constraints defined by
XML specification. These constraints are as follows:
The document contains one or more elements.
The document consists of exactly one root element (also known as the document element).
The name of an element’s end tag matches the name defined in the start tag.
No attribute may appear more than once within an element.
Attribute values cannot contain a left-angle bracket (<).
Elements delimited with start and end tags must nest properly within each other.
Validity
First and foremost, a valid XML document must be well-formed before it can even think about being a
valid XML document. The well-formed requirement should be fairly straightforward, but the key that
makes an XML document leap from well-formed to valid is slightly more difficult. To be valid, an XML
document must be validated. A document can be validated through a Document Type Definition (DTD), or
an XML Schema Definition (XSD). For the XML document to be valid, it must conform to the constraints
expressed by the associated DTD or the XSD schema.
3
Introduction to XML
04_596772 ch01.qxd  12/13/05  11:17 PM  Page 3