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

📄 0023-0026.html

📁 Presenting XML.rar,详细介绍有关XML的知识
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "html.dtd"><HTML><HEAD><TITLE>Presenting XML:Enter XML: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=02 //--><!--  PAGES=0019-0036 //--><!--  UNASSIGNED1 //--><!--  UNASSIGNED2 //--><P><CENTER><A HREF="0019-0022.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0027-0029.html">Next</A></CENTER></P><A NAME="PAGENUM-23"><P>Page 23</P></A><UL><LI>    Chemical formulae<LI>     Medical records<LI>    Museum catalog records<LI>    Chess games<LI>    Encyclopedia entries</UL><P>XML's role will be maximized in situations where the informationresources are of long-term value (since valid XML documents conform to anInternational Standard&#151;SGML); there are complex relationships within andbetween them (since XML's hyperlinking facilities allow these relationships to beexpressed in a system-independent manner); or if they are to be put todifferent uses (since it is much easier to repurpose information where it is marked upin a generalized manner). In those circumstances, people will be willing to putin the extra work of setting up an XML application. (It is certainly more workto adopt XML than to use HTML as it stands.)</P><P>One interesting possibility is that XML applications might be used toenhance HTML applications. For example, the Meta Content Framework proposalfrom Netscape et al involves the use of XML-encoded documents to describeand index Web sites. The XML contains a description of each page and ahyperlink to the actual page:</P><!--  CODE //--><PRE>&lt;Page id=&quot;http://www.acc.com/scorpions.html&quot;&gt;</A>&lt;description&gt;Scorpions in the sun&lt;/description&gt;&lt;/Page&gt;</PRE><!--  END CODE //--><P>A reverse link, from the HTML page to the page description, could bemade using the HTML link element.</P><H4><A NAME="ch02_ 7">The Role of HTML</A></H4><P>In many cases, using XML won't be worth the effort. For all itslimitations, HTML is a ready-to-run application that works &quot;out of the box.&quot; There isan enormous range of authoring software for creating HTML pages andlinks between them, software for managing HTML-based Web sites, and searchand index software for information retrieval.</P><P>Most Web sites exist primarily to promote an individual or organization,and to inform about their work and products. It is most important that thesepages deliver a clear, well-presented message&#151;using the information theycontain</P><A NAME="PAGENUM-24"><P>Page 24</P></A><P>for other purposes is not a high priority. For this type of site, HTML willprobably remain the most appropriate markup scheme.</P><P>Another role that HTML plays, and will probably continue to play, is asa delivery format for information from databases and other informationsources. Increasingly, software is becoming available that supports dynamic Websites, where pages are created on the fly. Their content can come partlyfrom prewritten chunks of HTML, and partly from databases. In the futurethis material might be delivered as XML, especially in situations where theclient that receives it wants to be able to do some local processing. But todaythe delivery format for these dynamic pages is firmly HTML.</P><TABLE BGCOLOR="#FFFF99"><TR><TD>Note:</TD></TR><TR><TD><BLOCKQUOTE>One exercise in this book requires you to take the basic HTML2.0 DTD and some Web pages, and morph them into XML. (See Chapter12, &quot;Morphing Existing HTML into XML.&quot;) However, the reason for doingthis is not to suggest that all existing HTML pages need to be converted toXML. On the contrary, you will find lots of reasons that it is not worth tryingto make this conversion, and you will come up with a better understanding ofthe differences between the HTML and XMLapproaches.</BLOCKQUOTE></TD></TR></TABLE><H4><A NAME="ch02_ 8">Browser Wars?</A></H4><P>Will a new generation of XML Web browsers come along to do battlewith current HTML browsers? I don't think so.</P><P>Because the XML language specification is so straightforward, it is quitefeasible for existing Web browsers to be upgraded so that they can showXML documents and HTML pages interchangeably. Users need not even beaware whether they are looking at XML or HTML! This process has alreadystarted&#151;Internet Explorer supports Channels, which areencoded in CDF (Channel Definition Format). This is an XML application. Integrating XMLsupport into HTML browsers removes the need for generic XML browsers.</P><P>There is another possible strategy, which might act as a fall-back if trueintegration of XML into HTML browsers isn't forthcoming. XML-awareplug-ins (which could be third-party offerings, written in Java) can take XML, <BR>convert it on the fly to HTML, and output the result to the browser'smain window. Either way, users get the benefit of XML delivery without needingto acquire a new Web browser.</P><A NAME="PAGENUM-25"><P>Page 25</P></A><P>On the other hand, it is likely that XML-specific browsers and plug-ins willbe created to provide specialized client-side support for particular XMLapplications. For example, if financial transactions are transmitted as XML,plug-ins would be required both to create and to decode them.</P><P>More generally, the linking facilities in XML can be used in a number ofnovel ways, and there is a place for a new generation of hypertext software thatsupports the creation and use of XML's out-of-line links. (See Chapter 9,&quot;Linking with XML,&quot; for the full story.)</P><H3><A NAME="ch02_ 9">XML-Lang: SGML Without Tears</A></H3><P>In Chapter 1, I gave you a taste of what generalized markup is and howSGML implements those ideas. I've already established that XML is a simpleSGML profile.</P><P>In this section I review the main features of the XML languagespecification. This is just a taster; the first few chapters of Part II give a much fuller picture.</P><H4><A NAME="ch02_ 10">Self-Describing Documents</A></H4><P>XML documents that satisfy XML's requirements for validity can be saidto describe themselves. (The concept of validity is described later in thesection &quot;Valid and Well-Formed Documents.&quot;) Every valid XML document startswith header information that does the following:</P><UL><LI>     Describes the structural rules that the markup in the documentaims to follow<LI>   Lists external resources (external entities) that might form part ofthe document<LI>     Declares internal resources (internal entities) that might berequired within the document<LI>     Lists types of non-XML resource (notations) that might be foundin the document (and for which helper applications might be required)<LI>     Lists actual non-XML resources (binary data entities) that mightbe found in the document (and for which helper applications mightbe required)</UL><A NAME="PAGENUM-26"><P>Page 26</P></A><P>This header information (known as the document typedefinition, or DTD) helps software that is about to process an XML document. It also allows XMLdocuments to be validated: Do they match up to their own rules? The DTD canbe complemented by processing instructions, which tell software how to dealwith the XML document, and by the other types of resources that might beencountered.</P><H4><A NAME="ch02_ 11">Clearer Is Simpler: Non-Minimized Markup</A></H4><P>Clarity is the watchword for the XML markup language. Say what youmean and don't miss anything. XML is very simple-minded and very rigorousabout markup.</P><P>A lesson learned from SGML (and HTML) is that minimization issomething you are better off without in XML. As an example, you might routinelyexclude the &lt;/p&gt; end-tag after eachparagraph:</P><!--  CODE //--><PRE>&lt;p&gt;Clarity is the watchword for the XML markup language. Saywhat you mean and don't miss anything. XML is very simple-minded and very rigorous about markup.&lt;p&gt;A lesson learned from SGML (and HTML) ...</PRE><!--  END CODE //--><P>You can do this because SGML-aware software can infer the presence ofthe &lt;/p&gt; end-tag from the arrival of the following&lt;p&gt; start-tag. (The DTD says that paragraphs can't nest; therefore, it is assuming a piece of markup ispresent because your rules say it must be there.)</P><P>This sort of cleverness can make life harder for all in the long run&#151;usersand software alike. In particular, it makes life hard for programmers who wantto process the markup.</P><P>Minimization techniques were introduced into SGML with the laudableaim of reducing the number of keystrokes needed to mark up text. This is nolonger an issue when a wide range of authoring software can add the markup for you.</P><P>Because XML insists on having all the markup be explicit, it is easy to seehow all the markup in a document is neatly nested. This nesting means thatelements can be described in terms of their contextual position, which hastwo obvious benefits:</P><UL><LI>     Simpler information modeling<LI>     Greater precision when searching</UL><P><CENTER><A HREF="0019-0022.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0027-0029.html">Next</A></CENTER></P></TD></TR></TABLE></BODY></HTML>

⌨️ 快捷键说明

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