📄 0328-0330.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="0325-0327.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="../ch18/0331-0334.html">Next</A></CENTER></P><A NAME="PAGENUM-328"><P>Page 328</P></A><P>In this syntax, DEFAULT enables attribute value defaulting,NONAME allows some attribute names to be omitted, andNOQUOTE allows some attribute values to be specified directly.</P><P>This legalizes XML's looseness in not necessarily naming attributes.</P><H4><A NAME="ch17_ 29">Attribute Definitions</A></H4><P>The syntax for ATTLIST is revised to provide the functionality of the syntax</P><!-- CODE SNIP //--><PRE><!ATTLIST "#NOTATION"? (name | name group | #IMPLICIT | #ALL ) attribute definition* ></PRE><!-- END CODE SNIP //--><P>where name is either an element type name or a notation name (dependingon whether #NOTATION is specified), name group is one or more names inparentheses, and #IMPLICIT refers to all implicitly defined element types (ornotation names). It is the equivalent of a name group. Finally,#ALL is all element type names or notation names.</P><P>With the #ALL keyword, the attribute definitions are associated with allelement type names (or notation names). Definitions associated with#ALL can be overridden by attribute declarations for specific element types ornotations, including definitions specified with#IMPLICIT (all implicitly defined element types or notations).</P><P>An attempt to redeclare an attribute that was previously declared for allelement types (or notations) is no longer to be treated as an error; only theearliest declaration will count (just as for entity declarations). But, on theother hand, multiple attribute lists that do not contain the same attributes areallowed and the final result will be a collation of all the attributes. This does,for example, allow an element's attributes to be supplemented by additionaldeclarations (possibly included, for example, in linked documents).</P><H4><A NAME="ch17_ 30">Implied DTDs</A></H4><P>In order to be able to parse SGML documents (or XML documents forthat matter) with or without a DTD, it is not enough to simply persuadeSGML that a DTD is not needed. The DTD is very heavily ingrained intoSGML thinking, and as far as existing SGML applications are concerned, the oldsystem (in which having a DTD is absolutely necessary) must still work. Whenyou add to this the need to be able to deal with documents that do notnecessarily declare a</P><A NAME="PAGENUM-329"><P>Page 329</P></A><P> DTD (the way an SGML document would), the need to be ableto handle partial documents, and XML's requirement to have one "rootelement" that is the beginning of the structural tree of the document, it is fairlyobvious that SGML needs to have some way to imply the DTD from a document.Two mechanisms help to achieve this: a new "imply document type name"declaration in the SGML declaration, and a new keyword in the SGML document.</P><H5><A NAME="ch17_ 31">IMPLYDEF <B>Declaration</B></A></H5><P>When IMPLYDEF DOCTYPE is specified in the SGML declaration and thereis only one document instance and no document type declarations, thedocument type declaration associated with the SGML document is assumed tobe this:</P><!-- CODE SNIP //--><PRE><!DOCTYPE #IMPLIED SYSTEM></PRE><!-- END CODE SNIP //--><P>This facility is used to imply the applicable DTD. When parsing withouta DTD, there is no need to imply one.</P><P>This IMPLYDEF declaration (now that you've started implying things) canalso be specified with the ELEMENT, ENTITY,%ENTITY, NOTATION, and ATTLIST keywords; thus, the corresponding statements can also be used without anexplicit declaration.</P><P>The implied definitions are as follows:</P><UL><LI> ELEMENT: - - ANY<LI> ENTITY,%ENTITY, NOTATION: SYSTEM<LI> ATTLIST: CDATA #IMPLIED for each attribute definition</UL><P>When IMPLYDEF ENTITY is specified, a default entity declaration is not permitted.</P><H5><A NAME="ch17_ 32">IMPLIED <B> Keyword </B></A></H5><P>The TC allows a new #IMPLIED to be used as an alternative to thedocument type name in a DOCTYPE declaration or the source document type name ina LINKTYPE declaration. Here's an example:</P><!-- CODE SNIP //--><PRE><!DOCTYPE #IMPLIED SYSTEM "some.dtd"> <book> .... </book></PRE><!-- END CODE SNIP //--><P>When this keyword is used, the document type name will be assumed tobe the element type name of the document element.</P><P>If #IMPLIED is specified, the document instance must begin with the starttag of the document element.</P><A NAME="PAGENUM-330"><P>Page 330</P></A><H4><A NAME="ch17_ 33">Internet Domain Names</A></H4><P>The last change I'll mention here is probably one of the last finishingtouches to make SGML truly ready for the World Wide Web. In the future, it willbe possible to use Internet IP domain names that contain only minimum dataas public text owner identifiers. To do so, the formal public identifier mustbegin with IDN</P><!-- CODE SNIP //--><PRE>//domain.name.</PRE><!-- END CODE SNIP //--><P>This almost brings SGML into line with XML, allowing it to use someInternet URLs as identifiers for public text. This doesn't go quite as far as XML,which is able to use "standard" Internet URLs (as defined by IETF RFC 1738).Just as with XML, however, the resolution mechanism for this is yet to beestablished.</P><H3><A NAME="ch17_ 34">Summary</A></H3><P>In what must have seemed like quite a circuitous journey, we have tracedthe history of a wide variety of standards in this chapter. We started withSGML and how it more or less gave birth to XML. We looked at some of theproblems that the combination of SGML and the Web had raised, and wefollowed their inheritance into XML where, hopefully, they will find theirresolution. Then, browsing through activities related to XML, we looked at thesupporting initiatives that will complete the definition of XML and make XML"ready for prime time."</P><P>Finally, coming almost full circle, we looked in some depth at themodifications that are being proposed for the SGML standard itself; modificationsthat will make XML documents valid SGML instances, thus opening the doorin both directions: to the Web for SGML and to "industrial use" for XML.</P><P><CENTER><A HREF="0325-0327.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="../ch18/0331-0334.html">Next</A></CENTER></P></TD></TR></TABLE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -