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

📄 0001-0006.html

📁 Presenting XML.rar,详细介绍有关XML的知识
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "html.dtd"><HTML><HEAD><TITLE>Presenting XML:Markup in Theory and Practice: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=01 //--><!--  PAGES=0001-0018 //--><!--  UNASSIGNED1 //--><!--  UNASSIGNED2 //--><P><CENTER><A HREF="../about.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0007-0009.html">Next</A></CENTER></P><A NAME="PAGENUM-1"><P>Page 1</P></A><H3><A NAME="ch01_ 1">PART  I</A></H3><H2>Introducing XML</H2><OL><LI>     Markup in Theory and Practice<LI>     Enter XML<LI>     The XML Advantage<LI>     Implementing XML</OL><A NAME="PAGENUM-2"><P>Page 2</P></A><A NAME="PAGENUM-3"><P>Page 3</P></A><H3><A NAME="ch01_ 2">CHAPTER  1</A></H3><H2><A NAME="ch01_ 3">Markup in Theory <BR>and Practice</A></H2><B>by Richard Light</B><P>This book aims to tell you about XML (eXtensibleMarkup Language). However, in order to understand XML, youneed some background.</P><P>In this chapter, you start by looking at what the termmarkup means, and then you learn about the idea ofgeneralized markup. You'll learn how the SGML standardimplements these ideas and then see how the HTML language canbe treated as an SGML application. This chapter covers thejobs that HTML does well, and it highlights some areaswhere HTML is struggling. By the end of this chapter, youshould have a good idea of what XML is and why it is needed.</P><A NAME="PAGENUM-4"><P>Page 4</P></A><H3><A NAME="ch01_ 4">What Is Markup?</A></H3><P>Markup is any additional information that is added to the text of adocument. You don't have to go far to find it: Every word processor inserts lots ofmarkup into the documents it creates. This markup is used to control the waythe document looks&#151;both on the screen and when it is printed out. Itrepresents things such as</P><UL><LI>       Font family and font size<BR><LI>       Bold, underlining, and italic<BR><LI>       Page size<BR><LI>       Margins<BR></UL><P>In addition, the markup used by many word processors can control moresophisticated aspects of document creation and presentation, such as</P><UL><LI>    Footnotes<BR><LI>     Bookmarks<BR><LI>    Tables of contents<BR><LI>    Index entries<BR></UL><P>Although you cause most of this markup to exist (by selecting font andparagraph styles, setting margins, and so on), in a modern word processingenvironment you never type it in explicitly, or even see it. You just see itsresults when your document looks and acts the way you intended.</P><TABLE BGCOLOR="#FFFF99"><TR><TD>Note:</TD></TR><TR><TD> <BLOCKQUOTE>The preceding wasn't always the case, because before WYSIWYG(what you see is what you get) systems came along, authors were often faced withthe job of inserting markup by hand.</BLOCKQUOTE></TD></TR></TABLE><P>In most cases, the markup is held in a binary format, so it wouldn't makeany sense to you even if you could look at it. However, on the journey fromits original SGML (XML-like) form to the Word format used by the Sams.neteditorial process, this book passed through a format calledRTF (Rich Text Format), which uses ASCII codes to representthe markup. This is the first paragraph of this chapter, encoded inRTF:</P><!--  CODE //--><PRE>\keepn\par\pard\sb240\sl-264 \b0\hyphpar0This book aims to tell you about XML (&quot;eXtensible Markup Language&quot;). However, in order to understand XML, you need somebackground.</PRE><!--  END CODE //--><A NAME="PAGENUM-5"><P>Page 5</P></A><P>All RTF control words begin with the \ character. The whole slew of them onthe first line tells how the paragraph will be formatted. Here is the meaningof this markup:</P><UL><LI>     \keepn: Keeps this paragraph with the next paragraph.<LI>     \par: Starts a new paragraph.<LI>     \pard: Restores the default paragraph properties.<LI>     \sb240: Twelve-point space before the paragraph.<LI>	\sl-264: Puts a 13.2-point space between lines. The negativevalue means that this spacing is used even if it is shorter than thetallest character.<LI>     \b0: Switches bold off.<LI>	 \hyphpar0: Switches off automatic hyphenation for the paragraph.</UL><P>RTF was developed with the aim of making it easier to transfer wordprocessor documents between different hardware platforms and softwarepackages. Its primary role is as an interchange format. RTF markup is clearlydocumented, as the preceding example shows. Any program that can read RTF filesand interpret the markup they contain is known asan RTF reader. Such a program doesn't have to be a word processor; it could easily be a read-only browseror a desktop publishing package.</P><TABLE BGCOLOR="#FFFF99"><TR><TD>Note:</TD></TR><TR><TD><BLOCKQUOTE>In this respect, at least, RTF is similar to XML. XML also is designedto allow documents to be interpreted correctly and used by different softwareon a wide range of hardware platforms.</BLOCKQUOTE></TD></TR></TABLE><H3><A NAME="ch01_ 5">What Is Generalized Markup?</A></H3><P>You just learned that markup is a fact of life&#151;at least in a wordprocessing setting. What is different aboutgeneralized markup?</P><P>The key distinction is that most of the markup in word processordocuments is there to help with the presentation of the document. Generalized, or descriptive, markup has a much simpler philosophy: It just indicates thestructural significance of a piece of text within the document as a whole. Thus,in the RTF example, the only instruction that counts as generalized markupis \par, which states that the next piece of text is a new paragraph.</P><A NAME="PAGENUM-6"><P>Page 6</P></A><P>If you apply a generalized approach to the RTF example, it immediatelysimplifies the markup:</P><!--  CODE SNIP //--><PRE>\par This book aims to tell you about XML: &quot;eXtensible Markup Language&quot;. However, in order to understand XML you need somebackground.</PRE><!--  END CODE SNIP //--><P>On the other hand, this means that the document no longer contains anyinstructions on how to display the paragraph!</P><P>In order to display and print documents containing generalized markup,you need some means of providing the formatting information that you havetaken out of the documents themselves. This is typically achieved by some sortof style sheet mechanism. A style sheet contains information on how eachstructural object within the document is to be formatted. Style sheets have acouple of advantages over formatting information embedded in the text:</P><UL><LI>     Consistency: All headings, paragraphs, and so on are formatted inthe same way. It is all too easy when using a word processor to decide ona different style for your headings and change them all by hand, onlyto miss one on the last page. I've done it. Haven't you?<LI>      Flexibility: By associating different style sheets with a document,you can make it look slightly different or totally different. Thus youcan easily create, for example, a large print edition of your documentsfor the visually handicapped in addition to the standard edition,without having to edit the source document at all.</UL><P>Desktop publishing software frequently uses a style sheetmechanism.</P><H3><A NAME="ch01_ 6">SGML</A></H3><TABLE BGCOLOR="#FFFF99"><TR><TD>Note:</TD></TR><TR><TD><BLOCKQUOTE>Because XML is actually based on the SGML standard, thisdescription of SGML deliberately has been kept short. Only aspects of SGML thathelp your understanding of the overall situation are described here. Anyspecific aspect of the SGML standard that also applies to XML will be describedin Part II, &quot;XML in Detail.&quot;</BLOCKQUOTE></TD></TR></TABLE><P>SGML, or Standard Generalized Markup Language, is an example of ageneralized markup system. It is an International Standard (ISO 8879:1986),which was first published in 1986. SGML provides a markup scheme that issimple,</P><P><CENTER><A HREF="../about.html">Previous</A> | <A HREF="../ewtoc.html">Table of Contents</A> | <A HREF="0007-0009.html">Next</A></CENTER></P></TD></TR></TABLE></BODY></HTML>

⌨️ 快捷键说明

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