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

📄 0044-0046.html

📁 Presenting XML.rar,详细介绍有关XML的知识
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "html.dtd"><HTML><HEAD><TITLE>Presenting XML:The XML Advantage: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=03 //--><!--  PAGES=0037-0050 //--><!--  UNASSIGNED1 //--><!--  UNASSIGNED2 //--><P><CENTER><A HREF="0041-0043.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0047-0049.html">Next</A></CENTER></P><A NAME="PAGENUM-44"><P>Page 44</P></A><P>to return the part of the document that matches this part code.&quot; Theserver still has the job of reading the whole document, but when it has locatedthe relevant section, it only has to deliver the required chunk to the client.Because much less data is transferred, the operation appears to be muchquicker to the client.</P><TABLE BGCOLOR="#FFFF99"><TR><TD>Warning:</TD></TR><TR><TD><BLOCKQUOTE>You need to resolve some issues concerning the relationshipbetween the chunk and the rest of the document. Obviously, users might wantto navigate from that chunk to other parts of the document, but withoutsome additional information their browsers won't be able to do that. TheSGML Open industry group is working on a framework for specifying achunk's context, which could be delivered along with the chunk and would allowyou to request items such as the next section in thedocument.</BLOCKQUOTE></TD></TR></TABLE><H3><A NAME="ch03_ 8">XML-Based Authoring</A></H3><P>Before looking at the advantages that XML will bring to its intended areaof application&#151;the World Wide Web&#151;I would like to make a pitch for themore general use of XML. The example I give covers the areas of documentauthoring and desktop publishing. This might appear to be a digression from thechapter's main purpose, but think about this: If standard word processors knewabout XML, we wouldn't need any specialized Web authoring tools!</P><P>XML lends itself to well-structured authoring. Word-processor vendorswould do well to consider re-engineering their offerings with XML at the center(rather than, say, having XML as an add-on or yet another &quot;save as&quot; format).</P><P>The format in which the word processor file is saved would be very simple.It would be a valid XML document with a processing instruction to specifythe editing style sheet that should be associated with it by default. The beautyof this approach is that the user would no longer have to worry aboutconverting documents from one proprietary format to another, with the seeminglyinevitable errors and loss of information.</P><H4><A NAME="ch03_ 9">Elements and Styles</A></H4><P>You can treat each XML element as equivalent to one of thestyles found in traditional word-processing applications. (It isn't an exact equivalence,because</P><A NAME="PAGENUM-45"><P>Page 45</P></A><P>the element has a more precise semantic significance and normally won'tcontain any style-specific information in its own right. However, from theauthor's point of view, it does basically the same job.)</P><P>The presence of a DTD allows you to control the addition of new elementsto the document structure. This means that the user always gets a context-<BR>sensitive pick list of just those elements that are allowed at the currentinsertion point. When an element is selected, the program inserts both astart-tag and an end-tag, and places the cursor between the two. By using theDTD, the program also can ensure that mandatory subelements and attributespecifications always are provided, so that documents are automatically valid XML.</P><P>A style mechanism such as Cascading Style Sheets (CSS) or XML'sbuilt-in XS mechanism can be used to associate a style (in the usual sense) witheach element type, which makes it very straightforward to offer WYSIWYGediting with user-defined styles using native XML functionality. (Youcertainly don't need to have the XML start-tags and end-tags visible, except perhapsas a user option.)</P><TABLE BGCOLOR="#FFFF99"><TR><TD>Note:</TD></TR><TR><TD><BLOCKQUOTE>Cascading Style Sheets offer a practicable method of stylingXML documents today. For the future, the power of XS means that you have considerable scopefor ingenuity and competition in the design of style support. It is clearly nota good idea to try to offer the full XS language to end-users. Some methodof packaging sets of primitive XS commands into useful procedures willbe needed.</BLOCKQUOTE></TD></TR></TABLE><P>By default, all instances of a given element will display identically. Inmost circumstances, this is an advantage. If you want to alter the style of yourfigure captions, it is helpful to be able to do the job once and know that everyfigure caption automatically will be updated.</P><P>However, sometimes you want to be able to control the style of elements ona case-by-case basis. This can be achieved by specifying attributes that willbe picked up by the style specification. For example, this book has differenttypes of note elements, which are controlled by thetype attribute. If this attribute is absent, the style sheet generates a boxed note with the heading&quot;note:&quot;. If this attribute has the value&quot;hidden&quot;, the note element is suppressed. If it hasany</P><A NAME="PAGENUM-46"><P>Page 46</P></A><P>that identifier to assign it a totally individual style.</P><H4><A NAME="ch03_ 10">Rules and Local Declarations</A></H4><P>The XML DTD has a two-part design, which lends itself to a simplestrategy for managing standard rules and local declarations. The standard rules fora set of documents (which the user cannot alter) can be declared as theexternal DTD subset. As you have seen, any non-XML resources that are to belinked into this particular document (such as illustrations) have to be declared inthe document header. Suitable declarations can be created by the programand added to the document's internal DTD subset:</P><!--  CODE //--><PRE>&lt;!DOCTYPE BOOK SYSTEM &quot;http://www.myorg.org/book.dtd&quot;</A> [&lt;!-- local declarations added here: --&gt;&lt;!ENTITY figure1 SYSTEM &quot;fig1.bmp&quot; NDATA BMP&gt;&lt;!ENTITY figure2 SYSTEM &quot;fig2.bmp&quot; NDATA BMP&gt;]&gt;</PRE><!--  END CODE //--><P>This keeps the standard rules and local declarations cleanlyseparated.</P><TABLE BGCOLOR="#FFFF99"><TR><TD>Note:</TD></TR><TR><TD><BLOCKQUOTE>In general, you can expect that XML-aware programs will take onthe job of including all the declarations that are required for XMLconformance. In this case, for example, all the user has to do is select an image file.As another example, the program can ensure that every element has a uniqueID, so that it is a suitable target for XML links.</BLOCKQUOTE></TD></TR></TABLE><H4><A NAME="ch03_ 11">The Revision Cycle</A></H4><P>In more ambitious implementations, XML's linking facilities could be usedto support commentary on, and editor review of, a source document. Thecomments could be held in a completely separate document, with XML linkspointing to the relevant passages of the original. This technique keeps thesource document &quot;clean.&quot; It also allows multiple comments on each document,comments on comments, and even comments that compare and contrast twoor more documents.</P><P><CENTER><A HREF="0041-0043.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0047-0049.html">Next</A></CENTER></P></TD></TR></TABLE></BODY></HTML>

⌨️ 快捷键说明

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