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

📄 0030-0032.html

📁 Presenting XML.rar,详细介绍有关XML的知识
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "html.dtd"><HTML><HEAD><TITLE>Presenting XML:Enter 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=02 //--><!--  PAGES=0019-0036 //--><!--  UNASSIGNED1 //--><!--  UNASSIGNED2 //--><P><CENTER><A HREF="0027-0029.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0033-0035.html">Next</A></CENTER></P><A NAME="PAGENUM-30"><P>Page 30</P></A><H4><A NAME="ch02_ 15">Character Sets</A></H4><P>XML has adopted the ISO 10646 (Unicode) standard as the approvedframework for encoding characters. This offers a variety of methods ofencoding characters as a bit pattern. The 8-bit encoding scheme is compatible withstandard ASCII, and the 16-bit and 32-bit encoding schemes offer built-insupport for most languages. This means that XML can scale up to whateverlevel of language support is required for a particular application. In fact, eachXML document can contain any mixture of characters and languages. You caneven use any alphabet within your markup. For example, you can have cyrillicnames for your element types. Putting it another way, internationalization is builtinto XML.</P><P>XML also provides a general-purpose character reference, with which youcan refer to any character in Unicode by quoting the numerical value of its bitstring. This is useful for characters that you cannot enter directly via thekeyboard.</P><H3><A NAME="ch02_ 16">XML-Link: Power Linking</A></H3><P>XML provides built-in linking facilities that aim to be powerful enough tocope with most Web-based applications.</P><H4><A NAME="ch02_ 17">Influences on the Design of XML-Link</A></H4><P>XML-Link is based on the distillation of many years of experience in thedesign of hyperlinks. Three standards, in particular, have informed its design:</P><UL><LI>     HTML provides a linking mechanism that is already familiarto everyone who has ever encoded a Web page.<LI>   HyTime is an International Standard that contains some usefulbackground concepts.<LI>     Text Encoding Initiative (TEI)Guidelines provide a concise syntax for specifying complex links.</UL><P>The general approach has been to start from the linking facilities supportedby HTML, and add value to them. It is quite straightforward to useHTML-style links within an XML document if you choose, like this:</P><!--  CODE SNIP //--><PRE>&lt;A HREF=&quot;http://www.w3c.org/XML/Activity&quot;&gt;</A></PRE><!--  END CODE SNIP //--><A NAME="PAGENUM-31"><P>Page 31</P></A><P>But you can also do a great deal more with XML links. (For compatibilitywith HTML, XML has adopted HREF as the name of the special attribute thatcontains the target of the link.)</P><H4><A NAME="ch02_ 18">Additional Information About Links</A></H4><P>XML allows you to state which elements in your XML documents are tobe interpreted as linking elements. You do this by specifying the specialXML-LINK attribute. This both asserts that an element is to be treated as a link andspecifies what type of link it is. For example, the following code states that this isa simple link (as discussed in the  next section):</P><!--  CODE SNIP //--><PRE>&lt;A XML-LINK=&quot;SIMPLE&quot; HREF=&quot;http://www.w3c.org/XML/Activity&quot;&gt;</A></PRE><!--  END CODE SNIP //--><P>Every link can have a machine-processible role. The role is the meaning ofthe link, and it tends to be specific to a particular XML application. It canalso have a human-readable label.</P><P>Finally, you can specify the default behavior of a link. TheSHOW attribute indicates whether the resource pointed to by the link is designed to beembedded in the current context, to replace it, or to start its own new context. The <BR>ACTUATE attribute indicates whether the user has to take action beforeanything is done with the link.</P><H4><A NAME="ch02_ 19">Simple and Extended Links</A></H4><P>HTML-style links are one example of what XML callssimple links. Simple links are links that sit in an XML document and point to a single target,or resource. (A resource is anything that can be addressed by alink.)</P><P>Extended links are a lot less obvious. They can point to any number oftargets, and they can live anywhere. In fact, extended links don't need to liveinside any of the resources they point to. This might not sound helpful, but in factit gives you the ability to set up bidirectional and even multidirectionallinks. Also, taking links out of documents should make it easier to manage them(for example, by checking that their target resource continues toexist).</P><P>XML lets you declare one or more XML documents as alink group, which makes it easier to manage a set of documents that contain a network of links.</P><A NAME="PAGENUM-32"><P>Page 32</P></A><H4><A NAME="ch02_ 20">Locators</A></H4><P>As I have noted, the value of the HREF attribute identifies the target resourceof an XML link, which has a syntax that is upward-compatible with theURL syntax currently used on the Web. This means that all XML links thatpoint to non-XML targets can be interpreted in exactly the same way as similarlinks found in HTML pages.</P><P>The XML syntax, which is based on that of URL, includes the use of# to separate the name of a resource from a part identifier. In the particular casewhere the target resource is an XML document, the part of the URL after the# must follow a special syntax that identifies which elements within thatdocument form the target of the link. For example, the easiest and best use of thissyntax is to specify that the unique ID of the target element is a link to theelement with ID equal to CHAP1 within the documentMYDOC.XML:</P><!--  CODE SNIP //--><PRE>&lt;A XML-LINK=&quot;SIMPLE&quot; HREF=&quot;MYDOC.XML#CHAP1&quot;&gt;</PRE><!--  END CODE SNIP //--><P>XML also supports the connector |, which offers the option that only therelevant element, and not the whole XML document, should be returned.This will save loading time when linking to small sections that are near the endof large documents.</P><P>The detailed syntax for locating elements within XML documents isdescribed in Chapter 9.</P><H3><A NAME="ch02_ 21">XML-Style: Separate Style from Content</A></H3><P>In principle, the existing CSS1 (Cascading Style Sheets, level 1) standardcould be applied to give simple control over the on-screen display of XMLdocuments. CSS1 states its rules in terms of element names, IDs, and so on, which areclearly features of XML documents as well as HTML documents.</P><P>CSS1 was specifically designed around HTML, and some of its featuresrely on HTML-specific encoding practices. For example, thea linking element is treated specially so that visited links can look different from unvisitedones. Similarly, the class attribute is treated specially by CSS1: You would haveto add that attribute to every element in your XML DTDs to take advantageof</P><P><CENTER><A HREF="0027-0029.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0033-0035.html">Next</A></CENTER></P></TD></TR></TABLE></BODY></HTML>

⌨️ 快捷键说明

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