⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0067-0070.html

📁 Presenting XML.rar,详细介绍有关XML的知识
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "html.dtd"><HTML><HEAD><TITLE>Presenting XML:The XML Approach:EarthWeb Inc.-</TITLE><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><SCRIPT><!--function displayWindow(url, width, height) {        var Win = window.open(url,"displayWindow",'width=' + width +',height=' + height + ',resizable=1,scrollbars=yes');}//--></SCRIPT></HEAD><BODY  BGCOLOR="#FFFFFF" VLINK="#DD0000" TEXT="#000000" LINK="#DD0000" ALINK="#FF0000"><TD WIDTH="540" VALIGN="TOP"><!--  <CENTER><TABLE><TR><TD><FORM METHOD="GET" ACTION="http://search.itknowledge.com/excite/cgi-bin/AT-foldocsearch.cgi"><INPUT NAME="search" SIZE="20" VALUE=""><BR><CENTER><INPUT NAME="searchButton" TYPE="submit" VALUE="Glossary Search"></CENTER><INPUT NAME="source" TYPE="hidden" VALUE="local" CHECKED> <INPUT NAME="bltext" TYPE="hidden" VALUE="Back to Search"><INPUT NAME="sp" TYPE="hidden" VALUE="sp"></FORM></TD><TD><IMG SRC="http://www.itknowledge.com/images/dotclear.gif" WIDTH="15"   HEIGHT="1"></TD><TD><FORM METHOD="POST" ACTION="http://search.itknowledge.com/excite/cgi-bin/AT-subscriptionsearch.cgi"><INPUT NAME="search" SIZE="20" VALUE=""><BR><CENTER><INPUT NAME="searchButton" TYPE="submit" VALUE="  Book Search  "></CENTER><INPUT NAME="source" TYPE="hidden" VALUE="local" CHECKED> <INPUT NAME="backlink" TYPE="hidden" VALUE="http://search.itknowledge.com:80/excite/AT-subscriptionquery.html"><INPUT NAME="bltext" TYPE="hidden" VALUE="Back to Search"><INPUT NAME="sp" TYPE="hidden" VALUE="sp"></FORM></TD></TR></TABLE></CENTER> --><!--  ISBN=1575213346 //--><!--  TITLE=Presenting XML//--><!--  AUTHOR=Richard Light//--><!--  PUBLISHER=Macmillan Computer Publishing//--><!--  IMPRINT=Sams//--><!--  CHAPTER=05 //--><!--  PAGES=0067-0084 //--><!--  UNASSIGNED1 //--><!--  UNASSIGNED2 //--><P><CENTER><A HREF="../ch04/0064-0066.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0071-0073.html">Next</A></CENTER></P><A NAME="PAGENUM-67"><P>Page 67</P></A><H3><A NAME="ch04_ 15">PART II</A></H3><H2><A NAME="ch04_ 16">XML in Detail</A></H2><OL START="5"><LI>       The XML Approach<LI>       Logical Structures in XML Documents<LI>       Physical Structures in XML Documents<LI>       Keeping It Tidy: The XML Rule Book<LI>       Linking with XML<LI>       The XML Style Mechanism<LI>       The XML Processor</OL><H3><A NAME="ch05_ 1">CHAPTER  5</A></H3><H2>The XML Approach</H2><B>by Richard Light</B><P>Part II, &quot;XML in Detail,&quot; takes a detailed look at allaspects of the XML specification. In this chapter, by way ofpreparation, I outline the general philosophy behind XML. Thearguments that determine the design of XML offer you agood insight into XML's overall approach.</P><P>After this I describe some general concepts that arenecessary to obtain a proper understanding of XML, and somespecific conventions that apply throughout the XML standard.The following topics will be covered:</P><UL><LI>     How XML represents individual characters<LI>     Low-level constructs that are referred tothroughout the XML specification<LI>     The distinction between the text in yourXML documents (character data) and markup</UL><A NAME="PAGENUM-68"><P>Page 68</P></A><UL><LI>    A technique for marking sections of an XML document sothat markup within them is ignored<LI>     How XML deals with white space (spaces, tabs, and newlines)<LI>     How to insert comments into your XML documents<LI>     What processing instructions are and how they are used<LI>    The distinction between thelogical structure and the physical structure of an XML document</UL><H3><A NAME="ch05_ 2">XML's Main Objectives</A></H3><P>What is XML all about? This is what the XML editors said in the June30, 1997 draft of XML-Lang: &quot;Extensible Markup Language (XML) is anextremely simple dialect of SGML which is completely described in this document.The goal is to enable generic SGML to be served, received, and processed onthe Web in the way that is now possible with HTML. XML has been designedfor ease of implementation and for interoperability with both SGML and HTML.&quot;</P><P>The general intent of this statement is pretty clear, but it might be helpfulto expand on a few specific points.</P><H4><A NAME="ch05_ 3">Generic SGML</A></H4><P>Generic SGML means any information that follows the SGML syntax. Thisis the big advantage that XML offers. Unlike HTML, XML gives Webinformation providers the power to define their own structures for theinformation they deliver.</P><P>In order to let XML offer the same degree of generality as SGML, somecompromises had to be made. Many SGML features had to be jettisoned sothat XML would be small and light enough to fly. But the ability to define anduse your own DTDs is central to XML, and this is what the phrasegeneric SGML denotes.</P><TABLE BGCOLOR="#FFFF99"><TR><TD>Note:</TD></TR><TR><TD><BLOCKQUOTE>In fact, one form of XML&#151;the well-formeddocument&#151;doesn't even require a DTD. This is described in the &quot;Well-Formed and ValidDocuments&quot; section, later in this chapter.</BLOCKQUOTE></TD></TR></TABLE><A NAME="PAGENUM-69"><P>Page 69</P></A><H4><A NAME="ch05_ 4">Interoperability with SGML</A></H4><P>Why should XML be interoperable with SGML? Isn't this a stepbackward? The answer is that two major types of benefits can be gained from makingXML interoperable with SGML.</P><P>For a start, what do I mean by interoperability in this context? In thiscase, interoperability means that all valid XML documents can be treated asthough they are SGML documents.</P><TABLE BGCOLOR="#FFFF99"><TR><TD>Warning:</TD></TR><TR><TD><BLOCKQUOTE>This is definitely a one-way street: It is most certainlynot possible to treat all SGML documents as though they are XMLdocuments!</BLOCKQUOTE></TD></TR></TABLE><P>Another way of looking at interoperability is to understand that &quot;all validXML documents are, by definition, valid SGML.&quot; This is the first benefit. SGMLis an international standard (ISO 8879:1986 to be precise), and all validXML documents are guaranteed to conform to it, without users having to takeany special measures to ensure conformity. Compare this with the HTMLexperience. Web services that validate HTML documents frequently reporterrors in pages that work perfectly on the Web. Making sure that all yourHTML pages are valid usually involves extra work for little obvious or immediatebenefit. If you take the trouble to ensure your XML documents are valid, youget SGML conformance for free.</P><P>The second benefit is that a fair amount of powerful software for workingwith SGML documents already exists: conversion tools, desktop publishingengines, document management systems, search tools, and so on. Interoperabilitymeans that this SGML software works, straight out of the box, on your XMLdocuments. No changes to the software means no changes to your documents!This also means that you can set up projects that use SGML software to processa mixture of XML and SGML documents.</P><TABLE BGCOLOR="#FFFF99"><TR><TD>Note:</TD></TR><TR><TD><BLOCKQUOTE>As a separate issue, SGML tools vendors might choose to producelower-cost versions of their products specifically for XML. Although this is clearlyto be welcomed, it doesn't remove the benefits to XML ofSGML interoperability.</BLOCKQUOTE></TD></TR></TABLE><A NAME="PAGENUM-70"><P>Page 70</P></A><H4><A NAME="ch05_ 5">Interoperability with HTML</A></H4><P>In what way can XML be interoperable with HTML? The two standardsare incompatible in terms of their scope: HTML is a specific application ofSGML, and XML is an SGML profile that supports many types of documents.</P><P>In this case, I think the answer lies in how the two standards are actuallyused on the Web. XML documents will use the same protocols as HTML:They will be requested and delivered using HTTP. The linking mechanism used <BR>by XML is based on the existing URL scheme and is upwardly compatible <BR>with it.</P><P>Assuming that Web browsers are extended to support XML as well asHTML, it will be possible to set up Web sites that are a glorious mix ofXML-encoded and HTML-encoded documents. You will be able to link from HTMLpages to XML documents (and vice versa), and your users won't even need to beaware that they jumped between HTML and XML.</P><P>HTML interoperability means that XML can be adopted gradually, andyour investment in existing HTML pages is safe. If you maintain a Web site,you might choose to write new pages in XML, and leave the rest of your site as itis. Or you might decide to continue using HTML for your core pages, andswitch to XML for only a particular set of specialized information that wouldbenefit from a custom DTD and tailored style sheets. Or you might decide notto bother with XML at all. It's your call. HTML won't goaway.</P><H3><A NAME="ch05_ 6">Design Goals</A></H3><P>XML's designers gave themselves 10 commandments, or design goals.Let's look at each of them to see what they tell us about the XML project.</P><H4><A NAME="ch05_ 7">1: XML Shall Be Straightforwardly Usable <BR>Over the Internet</A></H4><P>I've already touched on this while talking about interoperability withHTML. XML needs to use the communications protocols, such as HTTP, thatare already in place. It shouldn't impose any picky new requirements of its own.</P><P>Usable also suggests that you should be able to do something useful withan XML document after it has been delivered to you over the Internet. Thisis</P><P><CENTER><A HREF="../ch04/0064-0066.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0071-0073.html">Next</A></CENTER></P></TD></TR></TABLE></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -