📄 day1_3.html
字号:
<td colspan="2">-<a href="../../1-download/page1.htm">网页制作</a></td>
</tr>
<tr>
<td colspan="2">-<font color="#000000"><a href="../../1-download/page2.htm">程序设计</a></font></td>
</tr>
<tr>
<td colspan="2">-<font color="#000000"><a href="../../1-download/page3.htm">网站设计</a></font></td>
</tr>
<tr>
<td colspan="2">-<font color="#000000"><a href="../../1-download/page4.htm">电子商务</a></font>
</td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#666699"><a href="../../1-teach/index.htm"><font color="#FFFFFF">实用技巧</font></a></td>
</tr>
<tr>
<td colspan="2">-<a href="../../1-teach/internet/index.htm">Internet应用</a></td>
</tr>
<tr>
<td colspan="2">-<a href="../../1-teach/photoshop/index.html">Photoshop</a></td>
</tr>
<tr>
<td colspan="2">-<a href="../../1-teach/flash/page1.html">Flash</a></td>
</tr>
<tr>
<td colspan="2">-<a href="../../1-teach/asp/index.html">ASP</a></td>
</tr>
<tr>
<td colspan="2">-<a href="../../1-teach/php/index.html">PHP</a></td>
</tr>
<tr>
<td colspan="2">-<a href="../../1-teach/java/index.htm">Java</a></td>
</tr>
<tr>
<td colspan="2">-<a href="../../1-teach/vb/index.htm">VB</a></td>
</tr>
<tr>
<td colspan="2">-<a href="../../1-teach/c/index.htm">C、C++</a></td>
</tr>
<tr>
<td colspan="2">-<a href="../../1-backend/database/php_mysql/index.html">PHP/MySQL</a></td>
</tr>
<tr>
<td colspan="2"><a href="../../1-backend/cgi_perl/perl_beginner/index.html">-Perl</a>
</td>
</tr>
<tr>
<td colspan="2">-<a href="../../1-teach/other/index.htm">其它</a> </td>
</tr>
<tr>
<td colspan="2" bgcolor="#666699">
<div align="center"><font color="#FFFFFF">更多教程</font></div>
</td>
</tr>
<tr>
<td colspan="2" height="17"><a href="../../1hdml/index.html">-HDML</a></td>
</tr>
<tr>
<td colspan="2" height="23"><font face="宋体"><a href="../../1-backend/database/course/day1_1.html">-网络数据库</a></font></td>
</tr>
<tr>
<td colspan="2" height="14"><a href="../../1-backend/protocols/ping/index.html"><font face="arial, helvetica, sans-serif">Ping</font></a></td>
</tr>
<tr>
<td colspan="2" height="20"><a href="../../1-backend/cgi_perl/search_engine/index.html">-创建搜索引擎</a></td>
</tr>
<tr>
<td colspan="2" height="16">-<a href="../../1adobe/GoLive/index.html">Adobe GoLive</a></td>
</tr>
<tr>
<td colspan="2"><a href="../../1-backend/cgi_perl/templates/index.html">模板</a></td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#666699"><font color="#FFFFFF">合作伙伴</font></td>
</tr>
<tr>
<td colspan="2" align="left">-<a href="http://www.5dmedia.com/" target="_blank">5D精英网</a></td>
</tr>
<tr align="center">
<td colspan="2"> <img src="../../Library/front_monkey.gif" width="59" height="68"></td>
</tr>
</tbody>
</table>
<br><!-- #EndLibraryItem --></td>
<!-- End of headlines (column 1: left column) --> <!-- Gutter between columns 1 and 2 -->
<td width="10" height="794"><img src="http://www.sohu.com/images/pixel.gif" width=10></td>
<!-- Search box and directories (columns 2 and 3: middle columns, combined into one) -->
<td align=center valign=top width="558">
<div align="left"><!-- #BeginEditable "1" -->
<table border="0" width="550" cellspacing="0">
<tr>
<td width="458" valign="top" align="left"><br>
<strong>第三页:文档要组织良好</strong>
<p>一个XML文件必须满足两点:组织良好和有效。我们以一个组<br>
织良好的文档开始。</p>
<p>我发明了一些描述菜谱的标记符,并把它们组织成一种合理<br>
和可读的方式。它可能不是最好的标记,但是在下面的例子<br>
中工作得很好。</p>
<pre><?xml version="1.0"?>
<list>
<recipe>
<author>Carol Schmidt</author>
<recipe_name>Chocolate Chip Bars</recipe_name>
<meal>Dinner
<course>Dessert</course>
</meal>
<ingredients>
<item>2/3 C butter</item>
<item>2 C brown sugar</item>
<item>1 tsp vanilla</item>
<item>1 3/4 C unsifted all-purpose flour</item>
<item>1 1/2 tsp baking powder</item>
<item>1/2 tsp salt</item>
<item>3 eggs</item>
<item>1/2 C chopped nuts</item>
<item>2 cups (12-oz pkg.) semi-sweet choc. chips</item>
</ingredients>
<directions>
Preheat oven to 350 degrees. Melt butter;
combine with brown sugar and vanilla in large mixing bowl.
Set aside to cool. Combine flour, baking powder, and salt;
set aside.Add eggs to cooled sugar mixture; beat well.
Stir in reserved dryingredients, nuts, and chips.
Spread in greased 13-by-9-inch pan.
Bake for 25 to 30 minutes until goldenbrown;
cool. Cut into squares.
</directions>
</recipe>
</list></pre>
<p>这就是一份可以接受的XML文档 - 告诉你XML是什么:把数据<br>
以一种有实际意义的方式进行组织。</p>
<p>虽然这些标记符看起来有点象HTML,但是有很大的区别:文件<br>
中没有指出数据如何表示的信息。版面指令,当我们准备好时,<br>
就会从其它地方出现。这和把地址簿的信息放在数据库的字段<br>
和记录中而不是放在字处理器产生的清单中的道理一样。数据<br>
库可以让你把地址簿中的信息合成到标签、信封、信件或其它<br>
任何想要的载体上面。最后,就是把这份菜谱文件合成到一种<br>
表现语言中,如HTML或CSS。</p>
<p>前面说过,XML文档必须组织良好。这意味着文件必须满足以下<br>
三项基本规则:
<ol>
<li>文档以XML定义<?xml version="1.0"?>开始。</li>
<li>有一个包含所有其它内容的根元素,如上面例子中的<list><br>
和</list>标记符。</li>
<li>所有元素必须合理地嵌套,不允许交叉嵌套。 </li>
</ol>
<p>上面的例子中,几个<item>元素被合理地嵌套<ingredients>和<br>
</ingredients>标记符中。但是下面的标记却有严重的问题:</p>
<p><ingredients><item></ingredients>chocolate
chips</item></p>
<p>于是"chocolate chips"没有被包含在ingredients清单中。因此<br>
这份文档就没有组织好。这在HTML中可能不算什么,因为浏览器<br>
已经被设计成可以处理这种问题。</p>
<p>但是在XML中却是致命的 - 应用程序将拒绝处理没有组织好的<br>
文件。</p>
<p>我们现在知道组织良好非常重要,但是还不止这些。<a href="day1_4.html">>></a></p>
<p><strong>XML简介</strong><br>
<font color="#FF0000">第一页</font> <a href="day1_1.html">XML简介</a><br>
<font color="#FF0000">第二页</font> <a href="day1_2.html">以一份菜谱的例子开始</a><br>
<font color="#FF0000">第三页</font> 文档要组织良好<br>
<font color="#FF0000">第四页</font> <a href="day1_4.html">文档格式的排错</a></p>
<p>[第1天][<a href="day2_1.html">第2天</a>]</p>
<hr align="left" width="95%">
<!--webbot bot="Include" U-Include="../../copyright.html" TAG="BODY" startspan -->
<p><font color="#000000"><span class="smallfont"><span class="smallfont">本栏目内容归<a href="http://www.hotwired.com">Wired
Digital Inc.</a>所有,任何单位或个人未经许可,不得擅自转载使用。 <a href="http://www.sohu.com">搜狐</a>公司制作完成。</span></span></font></p>
<!--webbot bot="Include" endspan i-checksum="15926" --> </td>
</tr>
</table>
<!-- #EndEditable --></div>
</td>
<!-- End of search box and directories (columns 2 and 3: middle columns, combined into one) -->
<!-- Gutter between columns 3 and 4 --> <!-- Other stuff (column 4: right column) -->
<!-- End of other stuff (column 4: right column) --> </tr>
</table>
<!-- End of table surrounding page contents -->
<hr noshade size=1 width=700>
<span class=eng><br>
Copyright (C) 1998-2000 Internet Technologies China. All rights reserved.
</span>
</center>
</body>
<!-- #EndTemplate --></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -