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

📄 0205-0208.html

📁 Presenting XML.rar,详细介绍有关XML的知识
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "html.dtd"><HTML><HEAD><TITLE>Presenting XML:The XML Processor: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=11 //--><!--  PAGES=0201-0212 //--><!--  UNASSIGNED1 //--><!--  UNASSIGNED2 //--><P><CENTER><A HREF="0201-0204.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0209-0212.html">Next</A></CENTER></P><A NAME="PAGENUM-205"><P>Page 205</P></A><H4><A NAME="ch11_ 7">The DTD</A></H4><P>Where a document has both an internal DTD subset and an externalDTD subset, the XML processor must read the internal subset first, whichensures that local declarations take precedence over global ones.</P><P>In deciding whether to read the DTD at all, a nonvalidating XMLprocessor must take account of any required markupdeclaration (RMD) embedded in the XML declaration at the start of the document. The RMD will saywhich parts of the DTD must be processed in order to interpret the XMLdocument correctly. If an RMD is not provided, the XML processor must read thewhole DTD, if there is one, even when it is not trying to validate the XMLdocument. (See Chapter 8, &quot;Keeping It Tidy: The XML Rule Book,&quot; for a fulldescription of the RMD.)</P><H4><A NAME="ch11_ 8">Comments</A></H4><P>Where comments appear in the DTD or the document itself, the XMLprocessor might, but is not required to, make it possible for an application toretrieve the text of comments.</P><H4><A NAME="ch11_ 9">Attributes</A></H4><P>If an attribute list declares attributes for an element type that is not declaredin the DTD, a validating XML processor might warn the user of this fact.</P><P>The XML processor might warn the user if there is more than oneattribute list declaration for the same element type. This provides forinteroperability with existing SGML parsers, which do not permit repeated attribute listdeclarations.</P><P>Again, these are not errors.</P><P>Whenever an XML processor encounters an attribute value, it mustnormalize the value before passing it to the application. Normalizinginvolves the following:</P><UL><LI>          Replacing line-end characters (or, on some systems, recordboundaries) by a single space character<LI>          Expanding character references and references to internal text entities</UL><A NAME="PAGENUM-206"><P>Page 206</P></A><UL><LI>          Normalizing all strings of white space to single space charactersand removing leading and trailing white space, if the attribute is notof type CDATA<LI>          Folding to uppercase all attribute values of typeID, IDREF, IDREFs, NMTOKEN, NMTOKENs, and all enumerated or notation types</UL><TABLE BGCOLOR="#FFFF99"><TR><TD>Note:</TD></TR><TR><TD><BLOCKQUOTE>Normalization of attribute values applies only if the XML processoris reading the DTD; otherwise, all attribute values are treated as though theyare CDATA.</BLOCKQUOTE></TD></TR></TABLE><P>The XML processor must deal with attributes that have no specified value.If the rules in the attribute declaration provide a default value, the defaultvalue should be passed to the application as though the user had actuallyspecified that value. Otherwise, the XML processor must tell the application thatno value was specified for that attribute.</P><TABLE BGCOLOR="#FFFF99"><TR><TD>Note:</TD></TR><TR><TD><BLOCKQUOTE>Even though attribute default values are specified in markupdeclarations and therefore might be assumed to be of interest only to validatingXML processors, nonvalidating XML processors are also required to supplydefault values.</BLOCKQUOTE></TD></TR></TABLE><H4><A NAME="ch11_ 10">Notations</A></H4><P>When a notation is mentioned in an attribute value, attribute definition,or entity declaration, the XML processor must provide the application withthe following basic details about the notation:</P><UL><LI>          The notation's name<LI>          The notation's external identifier</UL><P>In addition, the XML processor might choose to resolve the externalidentifier and provide the application with information (such as a filename) that letsthe application actually call up a helper application to deal with the notationin question.</P><A NAME="PAGENUM-207"><P>Page 207</P></A><H4><A NAME="ch11_ 11">Conditional Sections</A></H4><P>The following keyword at the start of a conditional section is a parameterentity reference:</P><!--  CODE SNIP //--><PRE>&lt;![%optional.extras;[...]]&gt;</PRE><!--  END CODE SNIP //--><P>This parameter entity reference should be resolved before you decidewhether to include the following conditional section:</P><!--  CODE SNIP //--><PRE>&lt;![IGNORE[...]]&gt;</PRE><!--  END CODE SNIP //--><P>When processing an IGNORE conditional section, the XML processor mustread the conditional section to detect nested conditional sections and to ensurethat the end of the outermost (ignored) conditional section is properlydetected.</P><H3><A NAME="ch11_ 12">Treatment of Physical Structures</A></H3><P>The XML processor must be able to manage the physical entities thatconstitute an XML document. This section describes the conventions it should <BR>follow.</P><H4><A NAME="ch11_ 13">Document Entity</A></H4><P>The XML-Lang specification makes no statement on how the XMLprocessor is expected to locate the document entity, which will depend on theapplication environment in which the XML processor is running.</P><H4><A NAME="ch11_ 14">Entities</A></H4><P>The XML processor might warn the user if an entity is declared morethan once.</P><P>When trying to locate an entity that has aPUBLIC identifier, the XML processor might attempt to use thePUBLIC identifier to generate a URL for that entity. If this fails, the processor must use theSYSTEM identifier that accompanies the PUBLIC identifier. This guarantees that the XML processor will providethe application with the entity in some form (provided at least one URL is valid).</P><A NAME="PAGENUM-208"><P>Page 208</P></A><P>The XML processor is given very precise guidance on how to treatcharacter and general entity references. It should do the following:</P><UL><LI>          Tell the application that the entity reference has occurred, andprovide its name or number. For external entities, it also should providetheir SYSTEM and PUBLIC identifiers. For binary external entities, itshould provide the notation name and associated details of the notation.<LI>          Remove the reference from the text stream that is passed to theapplication.<LI>          For character references and internal (text) entities, insert theactual character or text in place of the reference. Any markup within thattext is to be interpreted (except when the entity itself is there to&quot;escape&quot; markup characters).<LI>          For external text entities, a validating XML processor must insertthe entity's content as part of the document. For well-formedness,however, an XML processor can, but is not required to, includethe external entity. This allows for XML browser applications,which might prefer to represent the entity as an icon, and allow the userto decide whether, and when, it should be retrieved.</UL><P>All XML processors must recognize the five built-in entities that are usedas markup delimiters in XML, regardless of whether they are declared:</P><UL><LI>          lt is mapped to&lt;<LI>          gt is mapped to&gt;<LI>          amp is mapped to&amp;<LI>          apos is mapped to`<LI>          quot is mapped to&quot;</UL><TABLE BGCOLOR="#FFFF99"><TR><TD>Note:</TD></TR><TR><TD><BLOCKQUOTE>A validating XML processor would additionally require that thebuilt-in entities are declared if they are referenced, so this stipulation matters onlyto nonvalidating XML processors.</BLOCKQUOTE></TD></TR></TABLE><P>Parameter entity references (which are found only in the DTD) arealways expanded as soon as they are encountered.</P><P><CENTER><A HREF="0201-0204.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0209-0212.html">Next</A></CENTER></P></TD></TR></TABLE></BODY></HTML>

⌨️ 快捷键说明

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