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

📄 0147-0150.html

📁 Presenting XML.rar,详细介绍有关XML的知识
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "html.dtd"><HTML><HEAD><TITLE>Presenting XML:Linking with 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=09 //--><!--  PAGES=0147-0178 //--><!--  UNASSIGNED1 //--><!--  UNASSIGNED2 //--><P><CENTER><A HREF="../ch08/0143-0146.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0151-0153.html">Next</A></CENTER></P><A NAME="PAGENUM-147"><P>Page 147</P></A><H3><A NAME="ch09_ 1">CHAPTER 9</A></H3><H2>Linking with XML</H2><B>by Richard Light</B><P>In Chapter 2, &quot;Enter XML,&quot; you learned about XML'slinking facilities at an outline level. This chapter exploreslinking in more detail.</P><P>To begin, I review the way Web links currently work, andI contrast that with XML's approach. Then I describesome specifics of XML links, such as the following:</P><UL><LI>     How XML links are identified<LI>    Information associated with XML links<LI>    XML simple links<LI>     XML extended links<LI>     XML's facilities for addressing portions oftarget documents<LI>    Extended link groups</UL><A NAME="PAGENUM-148"><P>Page 148</P></A><H3><A NAME="ch09_ 2">Putting XML Links into Context</A></H3><P>XML-Link aims to provide a much more powerful range of options forlinking than HTML offers. Certainly, the familiar &quot;click and jump&quot; type oflink will be supported. However, there will be significant new functionality ina number of areas, including the following:</P><UL><LI>    Typed links: Links with a specific role or behavior.<LI>     Two-way links: Links that can be traversed with equal ease ineither direction.<LI>    Multidirectional links: Links that connect two or more targets.</UL><P>The XML-Link specification simply allows authors to assert the presenceof links in XML documents. It gives each XML application the freedom todecide exactly how links, and the effects of clicking on them, should berepresented visually. The specification claims that it will provide &quot;an effectiveyet compact structure for representing links.&quot;</P><P>XML-Link is built upon years of research and experience into linking. Inparticular, it takes its ideas from HTML, an International Standard calledHyTime (ISO 10744:1992), and an SGML application called the Text EncodingInitiative (TEI). In this section, I cover HTML links and how they haveaffected the design of XML-Link.</P><H4><A NAME="ch09_ 3">HTML Links</A></H4><P>Let's start by reviewing the linking syntax provided by HTML, basingthe discussion on the recently released draft for HTML 4.0. Links can bemade from only two element types in the HTML 4.0 DTD:&lt;A&gt; and &lt;LINK&gt;.</P><P>&lt;LINK&gt; elements occur in the header information, and they indicaterelationships between the HTML document as a whole and other resources.&lt;A&gt; links can point to somewhere else in the current page, to another page on thesame site, or to anywhere else on the Web.</P><P>&lt;LINK&gt; elements must have either a REL or aREV attribute, and &lt;A&gt; elements can have one of the two. These attributes serve two purposes. They statethe intended direction of the link (because REV is areverse link into the current document). They also indicate what type of resource they are connectingthis document to, by taking values such as the following:</P><A NAME="PAGENUM-149"><P>Page 149</P></A><UL><LI>    Contents: A link to a document that acts as a table of contents.<LI>    Start: A link to the first document in a collection of documents.<LI>    Next: A link to the next document in an ordered sequence.</UL><P>The key part of the link is the HREF attribute. This contains the target ofthe link, expressed as a URL (Uniform Resource Locator).</P><P>URLs take the following general form:</P><!--  CODE SNIP //--><PRE>&lt;scheme&gt;:&lt;scheme-specific-part&gt;</PRE><!--  END CODE SNIP //--><P>RFC 1738 describes the following schemes:</P><UL><LI>     ftp: File Transfer Protocol<LI>     http: Hypertext Transfer Protocol<LI>     gopher: The Gopher protocol<LI>    mailto: Electronic mail address<LI>     news: USENET news<LI>    nntp: USENET news using NNTP access<LI> telnet: Reference to interactive sessions<LI>  wais: Wide Area Information Servers<LI>  file: Host-specific filenames<LI>rospero: Prospero Directory Service</UL><P>Links to other HTML pages use the HyperText Transfer Protocol(HTTP) scheme. An HTTP URL takes the following form:</P><!--  CODE SNIP //--><PRE>http://&lt;host&gt;:&lt;port&gt;/&lt;path&gt;?&lt;searchpart&gt;</PRE><!--  END CODE SNIP //--><P>Here are some examples:</P><!--  CODE //--><PRE>http://www.anothersite.org/xml/bigintro.html</A>http://www.anothersite.org/cgiwin.exe?getrecord:1014:field1=archives</A></PRE><!--  END CODE //--><P>The characters that can be entered directly within a URL'spath or searchpath are limited to letters, digits,safe characters ($, -, _, ., and +), and extracharacters (!, *, `, ,, and space). Any other character has to beescaped, using % followed by that character's code expressed as a hexadecimal number.</P><P>Characters that always need to be escaped within a URL include thefollowing: #, &lt;, &gt;, &quot;, %, and the space character.</P><A NAME="PAGENUM-150"><P>Page 150</P></A><P>Within the HTTP scheme, the characters ?, /, and; are reserved, which means that they must be encoded if the actual character is required in the URL.</P><P>The URL might be followed by the symbol # and afragment identifier:</P><!--  CODE SNIP //--><PRE>http://www.anothersite.org/xml/bigintro.html#section2</A></PRE><!--  END CODE SNIP //--><P>The fragment identifier should match the name attribute of an&lt;a&gt; element within the target document:</P><!--  CODE SNIP //--><PRE>&lt;a name=&quot;section2&quot;&gt;</PRE><!--  END CODE SNIP //--><P>The fragment identifier is not part of the URL itself.</P><TABLE BGCOLOR="#FFFF99"><TR><TD>Note:</TD></TR><TR><TD><BLOCKQUOTE>Starting with HTML 4.0, the fragment identifier can instead matchthe ID of any element in the target document. This brings HTML practicemore into line with the XML approach, discussed in the following section.</BLOCKQUOTE></TD></TR></TABLE><H4><A NAME="ch09_ 4">Interoperability with HTML Links</A></H4><P>The designers of the XML link syntax took care to build on what alreadyworks in HTML.</P><P>As you know, the XML language is intended to support generalizedmarkup on the Web. This clearly means that XML's linking facilities need to workin that environment as well. In particular, HTML and XML mustbe interoperable. This means that your Web site can freely &quot;mix andmatch&quot; HTML pages and XML documents, with links running between them asnecessary. To achieve this, the following (new) types of links need to work:</P><UL><LI>     Links from an XML document to an HTML page<LI>     Links from an XML document to another XML document<LI>     Links from an HTML page to an XML document</UL><P>XML-Link achieves interoperability with HTML by adopting the familiarHREF attribute and giving its value the same general meaning as in HTML.HREF's value is a URL identifying the resource that is the target of the link,optionally qualified by # (or |) and a fragment identifier, or by? and a query. Furthermore, XML-Link conforms to RFC 1738's conventions regarding thecharacters that can appear within the URL itself.</P><P><CENTER><A HREF="../ch08/0143-0146.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0151-0153.html">Next</A></CENTER></P></TD></TR></TABLE></BODY></HTML>

⌨️ 快捷键说明

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