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

📄 0014-0017.html

📁 Presenting XML.rar,详细介绍有关XML的知识
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "html.dtd"><HTML><HEAD><TITLE>Presenting XML:Introducing 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=01 //--><!--  PAGES=0001-0018 //--><!--  UNASSIGNED1 //--><!--  UNASSIGNED2 //--><P><CENTER><A HREF="0010-0013.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0018-0018.html">Next</A></CENTER></P><A NAME="PAGENUM-14"><P>Page 14</P></A><P>This situation is compounded by the approach adopted by most Webbrowser software, which is to ignore the document type declaration, if provided,and simply skip all markup that the browser doesn't understand. This leads torobust performance because all markup errors in the page being viewedautomatically will be ignored. However, it makes things even worse for thosewho want to use the full power of SGML in their Web pages. SGML has someclever features, such as marked sections and the use of general entities to pullin boilerplate text, which are not picked up by Web browsers. Any HTMLpage that is valid SGML but uses these features actually will be displayedincorrectly.</P><P>When a browser vendor provides support for additional element types(for example, for frames), it is by no means certain that the vendor will alsoprovide an updated (unofficial) HTML DTD in which those element typesare declared. In this case, it becomes impossible for users to create pages usingthese extensions that are valid SGML.</P><P>It is quite possible, on the other hand, to create HTML pages that arevalid SGML. You can use the validation services at<A HREF="http://www.webtechs.com/html-val-svc/">http://www.webtechs.com/html-val-svc/</A> and<A HREF="http://ugweb.cs.ualberta.ca/~gerald/validate/">http://ugweb.cs.ualberta.ca/~gerald/validate/</A> to checkany HTML page for validity. A common approach is to use the full power ofSGML to manage your pages in-house, and then put them through anormalization program that resolves and removes all the funny SGML things thatconfuse Web browsers, such as general entity references and marked sections. Onlythe normalized pages (which are still valid SGML) are deployed on theWeb.</P><H4><A NAME="ch01_ 16">The Advantages of HTML</A></H4><P>Overall, the Web community has ignored the fact that HTML is anSGML application. Or, to paraphrase Paul Simon's song &quot;The Boxer,&quot; the Webcommunity &quot;takes what it needs and disregards the rest.&quot; This hasn't causedthe community any great pain, mainly because HTML is actually very good atthe job for which it was designed.</P><P>As a means of supporting cross-platform Web page presentation, HTMLworks well. It uses SGML-style markup to achieve its goal of a reasonablyconsistent on-screen presentation. In addition to the element types declared in theHTML</P><A NAME="PAGENUM-15"><P>Page 15</P></A><P>DTDs, this markup includes entity references for characters that arerepresented differently on different platforms&#151;another SGML technique. Here aresome examples:</P><UL><LI>&amp;pound; is the pound sign.<LI>&amp;frac14; is the symbol for one quarter.<LI>&amp;uml; is an umlaut.</UL><P>Adding HTML markup proved to be so straightforward that originallymany Web pages were authored using a simple text editor. (The widespreadavailability of free and cheap WYSIWYG HTML authoring tools and theincreasing sophistication of the average Web page have lessened the need for handcoding.)</P><P>As you have seen, the hyperlinking mechanism in HTML makes no useof possible approaches suggested by SGML. Despite this, it has proven to bevery effective at linking within and between Web pages. Similarly, multimediasupport has been provided without requiring the use of SGML entityreferences or the concept of notations. Web pages now link in many moreinformation types (video clips, audio clips, and Java applets) than were originallyenvisaged without any problems.</P><H3><A NAME="ch01_ 17">HTML: Where the Cracks Are Beginning to Show</A></H3><P>It could be argued that HTML is starting to be a victim of its own success.As the only show in town when it comes to delivering Web content, HTMLis being expected to do the following:</P><UL><LI>     Display extremely long pages.<LI>     Provide better control over how pages look.<LI>     Support many types of hyperlinks.<LI>    Deliver an increasing variety of information on intranets as well asthe Internet.</UL><P>Let's examine each of those points.</P><A NAME="PAGENUM-16"><P>Page 16</P></A><H4><A NAME="ch01_ 18">Displaying Extremely Long Pages</A></H4><P>Many HTML documents are much too long to be calledpages. However, the HTML DTDs provide little support for breaking each page into logicalsections. The only top-level structural elements are</P><UL><LI>     head: The title and other front matter for the page<LI>   body: The main body of the page</UL><P>Within body, HTML 2.0 doesn't provide any means of dividing the bodytext into smaller sections. HTML 3.2 provides thediv element type, which in principle can be used for this purpose.</P><P>In order to encode a long text so that it looks sensible on the screen andretains a logical representation of its structure, you need to use HTML 3.2 andcarefully align the different levels of headings(h1, h2, and so on) with a set of nested div elements:</P><!--  CODE //--><PRE>&lt;body&gt;&lt;div&gt;&lt;h1&gt;1. The Main Point&lt;/h1&gt;&lt;p&gt; ...&lt;div&gt;&lt;h2&gt;1.1 The first sub-point&lt;/h2&gt;&lt;p&gt; ...&lt;/div&gt; &lt;!-- end of section 1.1 --&gt;&lt;div&gt;&lt;h2&gt;1.2 The second sub-point&lt;/h2&gt;&lt;p&gt; ...&lt;div&gt;&lt;h3&gt;1.2.1 A very small point&lt;/h3&gt;&lt;/div&gt;&lt;/div&gt; &lt;!-- end of section 1.2 --&gt;&lt;div&gt;&lt;h2&gt;1.3 The third sub-point&lt;/h2&gt;&lt;p&gt; ...&lt;/div&gt; &lt;!-- end of section 1.3 --&gt;&lt;/div&gt; &lt;!-- end of section 1 --&gt;...</PRE><!--  END CODE //--><P>However, the DTD does very little to help you with this approach. Forexample, any level of heading can occur anywhere in the text, so it would beall too easy to put an h2 element where you meant to put anh3. This wouldn't be an error as far as the DTD wasconcerned.</P><P>Another way of tackling this problem is to break the long page into anumber of linked pages. However, that adds an extra authoring and maintenanceoverhead to the document. Unless it is done with care, it can make thedocument less accessible to end users. Frames can help with the presentation oflarge documents, and are supported by the current HTML 4.0 draft. However,you can be sure that some of your users won't have frames-enabledbrowsers.</P><A NAME="PAGENUM-17"><P>Page 17</P></A><H4><A NAME="ch01_ 19">Providing Better Control Over Page Layout</A></H4><P>Trying to get a Web page to look correct on any platform and with anybrowser becomes harder in proportion to the sophistication of the page. Codingtricks such as single-pixel images are now routinely used to achieve the desired layout.</P><P>Conversely, as a client with special needs, I might want to make the Webpages I receive look different.</P><P>Having the layout information as part of the page markup is proving to bea limitation. The CSS initiative solves part of this problem by providing aseparate style sheet mechanism that can be applied by the server site or by the enduser.</P><H4><A NAME="ch01_ 20">Supporting Multiple Types of Hyperlinks</A></H4><P>The single link type supported by HTML doesn't support the variety oftypes of relationships that actually occur between pages. If each page is seen as aunit of information, the pages around it can have a variety of roles. Some are&quot;see also&quot; pages giving interesting related information. Others are &quot;partof&quot; pages, which are structurally linked to the current page and form an integral partof a document that has been split up into a number of pages (for the reasonsjust outlined). Being able to distinguish these different types of links wouldallow the Web browser to offer better navigation. At a minimum, Up andDown buttons could be used to navigate hierarchically, as well as the ubiquitousBack button.</P><H4><A NAME="ch01_ 21">Delivering Any Type of Information</A></H4><P>HTML is most clearly struggling in the area of information delivery.Many applications now hold information in an application-specific format andconvert it to HTML for delivery on the Web. In Chapter 14, &quot;Creating anXML Museum Information Application,&quot; you will see how museum recordshave been converted to HTML as a one-off process or on the fly as they arerequested.</P><P>Converting to HTML at the time of delivery has a number ofdisadvantages. In general terms, this design means that only the Web server has the fullpicture. In a database-driven Web site, all conversion (to HTML) must bedone by the server. Every time the client wants to make another decision, she hasto have another interaction with the server. More HTML has to bedownloaded. This adds massively to the load on the server and, indeed, the wholeInternet, with a corresponding degradation in response times for everyone.</P><P><CENTER><A HREF="0010-0013.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0018-0018.html">Next</A></CENTER></P></TD></TR></TABLE></BODY></HTML>

⌨️ 快捷键说明

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