📄 0325-0327.html
字号:
<!DOCTYPE HTML PUBLIC "html.dtd"><HTML><HEAD><TITLE>Presenting XML:Resolution of the XML Specification: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=17 //--><!-- PAGES=0309-0330 //--><!-- UNASSIGNED1 //--><!-- UNASSIGNED2 //--><P><CENTER><A HREF="0322-0324.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0328-0330.html">Next</A></CENTER></P><A NAME="PAGENUM-325"><P>PAGE 325</P></A><UL><LI> Fully taggeddocuments: These are documents in which every element has a proper start tag, end tag, and name (called ageneric identifier), and the name of every attribute is present in the start tagin every attribute specification.</UL><P>In addition to these new types of documents, the TC introduces newconcepts concerning the storage of elements. The following new concepts also canbe used to define the kind of processing required, but they are primarilystorage oriented:</P><UL><LI> Integrally storeddocuments: These are documents in which every markedsection and every element ends in the entity in which itstarted (which is necessary for XML to allow parsing to continue afterfailing to resolve an entity reference).<LI> Reference-freedocuments: These are documents that have no entity references other than delimiter references, although they cancontain attribute values that refer to entities. (This is needed for systemsthat cannot resolve entity references or, if the document is tag valid,for systems that cannot parse DTDs.)<LI>External-reference_free documents: These are documents thathave no external entity references, although they can containattribute values that refer to entities. (This is needed for systems thatcannot resolve external entity references.)<LI>Entity-declaration_free documents: These are documents thathave no entity references at all. (If the document is tag valid, it canbe parsed by systems that cannot parse DTDs.)</UL><P>Taking all these definitions together and relating them to XML, awell-formed XML document would, in these new SGML terms, betag valid and integrally stored.</P><H4><A NAME="ch17_ 22">SGML Declaration Changes</A></H4><P>Many of the changes affected by the TC are concerned with the SGMLdeclaration that often precedes the SGML DTD. If the default SGML declarationis acceptable (the "Reference Concrete Syntax"), an SGML declaration isnot needed. Where an SGML declaration is used, it allows you to define thelexical structure of a document (the DTD provides the description of thesyntactic structure), what characters can appear in the document, how they are tobe recognized, and what their functions are.</P><A NAME="PAGENUM-326"><P>Page 326</P></A><P>In the following sections, I'll give you a brief overview of some of themost important changes and additions. Don't forget, though, that the TC is stilla proposal and can still change.</P><H4><A NAME="ch17_ 23">SGML Declaration References</A></H4><P>One of the other most important changes brought about by the TC (nextto not having a DTD) will be the fact that a subdocument will be able tocontain an SGML declaration.</P><P>To implement this, an alternative form of the SGML declaration ispermitted (known as an SGML declaration reference, which references an SGMLdeclaration body). SD is added as a new public text class to identify an SGMLdeclaration body.</P><H4><A NAME="ch17_ 24">Capacities and Quantities</A></H4><P>The CAPACITY parameter in the SGML declaration limits the total numberof certain objects that can appear in an SGML document (such as the totalnumber of elements and the total number of entities). The TC introduces anew keyword, NOLIMITS, to indicate that there are no capacity limits. (In theSGML declaration for XML, the quantities are all set to99999999 to get around the capacity limits.)</P><P>The QUANTITY parameter in the SGML declaration limits the total lengthof certain objects that can appear in an SGML document (such as the lengthof element names). The TC introduces a new keyword,NOLIMITS, to indicate that there are no quantity limits exceptBSEQLEN (the length of a blank sequence recognized as a short reference), which has the quantity specified for it inthe reference quantity set (960 characters). However, specifyingQUANTITY NOLIMITS does not necessarily mean that a system will be able to support unlimited <BR>quantities!</P><H4><A NAME="ch17_ 25">Assertions</A></H4><P>The TC adds two new assertions, which are statements about the kind ofprocessing that a document requires. These assertions are thecheck validity assertions and the check entity constraintassertions.</P><P>The check validity assertions are declared using a newVALCHECK parameter that allows a document to assert whether it is type valid, tag valid, or both.Here's the syntax:</P><P>VALCHECK, (TAGVALID?, TYPVALID?)</P><A NAME="PAGENUM-327"><P>Page 327</P></A><P>The SGML parser will report an error if an assertion is untrue; therefore, ifan otherwise conforming type-valid document incorrectly asserts that it is tagvalid, the document is no longer considered to be conforming. Had theassertion not been made, the document would have been conforming.</P><P>The check entity constraint assertions are declared using a newENTCHECK parameter that allows a document to assert whether it satisfies specifiedconstraints. The syntax of this assertion is</P><P>ENTCHECK, (INTEGRAL?, (NOREF | NOEXTREF | NOENTDEC)?)</P><P>where INTEGRAL specifies that the document instance is integrally stored,NOREF specifies that the document is reference free,NOEXTREF specifies that the document is external reference free, andNOENTDEC specifies that the document is entity declaration free.</P><P>The SGML parser reports a markup error if an assertion is untrue. If anotherwise conforming SGML document incorrectly asserts that it is integrallystored, the document will be treated as being nonconforming; on the other hand,if the assertion was not made, the document would have been conforming.</P><H4><A NAME="ch17_ 26">Empty Start and End Tags</A></H4><P>The TC defines a new delimiter role called aNESTC, which is a "NET-enabling start tag close."</P><P>This brings SGML into line with XML, making XML's use of the specialend tag for empty elements acceptable. In SGML, ifNESTC is / and NET is >, an empty img element with a null end tag would look just like it would in XML:</P><!-- CODE SNIP //--><PRE><img/></PRE><!-- END CODE SNIP //--><H4><A NAME="ch17_ 27">Hexadecimal Character References</A></H4><P>The TC adds a new hexadecimal character reference open(HCRO) delimiter that can be used to represent a numeric character reference by a hexadecimalstring. Again, this brings XML into line with SGML, or vice versa, makingXML's hexadecimal declarations (&amp;#x) legal.</P><H4><A NAME="ch17_ 28">Attribute Minimization</A></H4><P>A new attribute minimization keyword is added to the SGMLdeclaration, which has the following syntax:</P><!-- CODE SNIP //--><PRE>(ATTS, (DEFAULT?, NONAME?, NOQUOTE?))?</PRE><!-- END CODE SNIP //--><P><CENTER><A HREF="0322-0324.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0328-0330.html">Next</A></CENTER></P></TD></TR></TABLE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -