📄 day2_2.html
字号:
<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>第二页:DTD的完整例子</strong>
<p>下面是一个完整的例子。我把另一个菜谱加入文件内,并为<br>
DTD做了注释。可以注意到我在第二个菜谱中用到子条目。</p>
<pre><small><?xml version="1.0"?></small></pre>
<pre><small> <!--This starts the DTD. The first four lines address document structure--></small></pre>
<pre><small> <!DOCTYPE list [ </small></pre>
<pre><small> <!ELEMENT recipe (recipe_name, author, meal, ingredients,directions)> </small></pre>
<pre><small> <!ELEMENT ingredients (item+)> </small></pre>
<pre><small> <!ELEMENT meal (#PCDATA, course?)> </small></pre>
<pre><small> <!ELEMENT item (#PCDATA, sub_item*)> </small></pre>
<pre><small> <!--These are the remaining elements of the recipe tag --> </small></pre>
<pre><small> <!ELEMENT recipe_name (#PCDATA)> </small></pre>
<pre><small> <!ELEMENT author (#PCDATA)> </small></pre>
<pre><small> <!ELEMENT directions (#PCDATA)> </small></pre>
<pre><small> <!--The remaining element of the meal tag --> </small></pre>
<pre><small> <!ELEMENT course (#PCDATA)> </small></pre>
<pre><small> <!--The remaining element of the item tag --> </small></pre>
<pre><small> <!ELEMENT sub_item (#PCDATA)></small></pre>
<pre><small>]></small></pre>
<p> </p>
<pre><small><?xml version="1.0"?> </small></pre>
<pre><small> <list> </small></pre>
<pre><small> <recipe> </small></pre>
<pre><small> <author>Carol Schmidt</author> </small></pre>
<pre><small> <recipe_name>Chocolate Chip Bars</recipe_name> </small></pre>
<pre><small> <meal>Dinner </small></pre>
<pre><small> <course>Dessert</course> </small></pre>
<pre><small> </meal></small></pre>
<pre><small> <ingredients> </small></pre>
<pre><small> <item>2/3 C butter</item> </small></pre>
<pre><small> <item>2 C brown sugar</item> </small></pre>
<pre><small> <item>1 tsp vanilla</item> </small></pre>
<pre><small> <item>1 3/4 C unsifted all-purpose flour</item> </small></pre>
<pre><small> <item>1 1/2 tsp baking powder</item> </small></pre>
<pre><small> <item>1/2 tsp salt</item> </small></pre>
<pre><small> <item>3 eggs</item> </small></pre>
<pre><small> <item>1/2 C chopped nuts</item> </small></pre>
<pre><small> <item>2 cups (12-oz pkg.) semi-sweetchoc. chips</item> </small></pre>
<pre><small> </ingredients> </small></pre>
<pre><small> <directions></small></pre>
<pre><small> Preheat oven to 350 degrees. Melt butter; </small></pre>
<pre><small> combinewith brown sugar and vanilla in large mixing bowl.</small></pre>
<pre><small> Set aside to cool. Combine flour, baking powder, andsalt; </small></pre>
<pre><small> set aside.Add eggs to cooled sugar mixture; beat well. </small></pre>
<pre><small> Stir in reserved dry ingredients, nuts, and chips.</small></pre>
<pre><small> Spread in greased 13-by-9-inch pan. </small></pre>
<pre><small> Bake for 25 to 30minutes until golden brown; cool. </small></pre>
<pre><small> Cut into squares. </small></pre>
<pre><small> </directions> </small></pre>
<pre><small> </recipe> </small></pre>
<pre><small> <recipe> </small></pre>
<pre><small> <recipe_name>Pasta with tomato Sauce</recipe_name> </small></pre>
<pre><small> <meal>Dinner </small></pre>
<pre><small> <course>Entree</course> </small></pre>
<pre><small> </meal> </small></pre>
<pre><small> <ingredients> </small></pre>
<pre><small> <item>1 lb spaghetti</item> </small></pre>
<pre><small> <item>1 16-oz can diced tomatoes</item> </small></pre>
<pre><small> <item>4 cloves garlic</item> </small></pre>
<pre><small> <item>1 diced onion</item> </small></pre>
<pre><small> <item>Italian seasoning </small></pre>
<pre><small> <sub_item>oregano</sub_item> </small></pre>
<pre><small> <sub_item>basil</sub_item> </small></pre>
<pre><small> <sub_item>crushed red pepper</sub_item></small></pre>
<pre><small> </item> </small></pre>
<pre><small> </ingredients> </small></pre>
<pre><small> <directions></small></pre>
<pre><small> Boil pasta. Sauté garlic and onion. </small></pre>
<pre><small> Add tomatoes.Serve hot. </small></pre>
<pre><small> </directions> </small></pre>
<pre><small> </recipe></small></pre>
<pre><small></list></small></pre>
<p>既然有DTD,文档将被检查看是否符合DTD做出的限制。换句话<br>
说,我们要保证文档的有效性。</p>
<p>为了达到这个目的,我们需要另一个工具:有效性分析器。微软<br>
的<a href="http://www.microsoft.com/xml/parser/jparser.asp" target="_blank">MSXML</a>,一个基于Java的程序,使用容易又工作得很好。上面的<br>
文档经过这个程序的检查后没有发现错误。但是如果我检查一个<br>
ingredient标记符中没有包含条目的菜谱,将会返回以下信息:</p>
<tt>
<p><small>ingredients is not complete. Expected elements [item].</small></p>
</tt>
<p><a href="day2_3.html">>></a></p>
<p><strong>XML简介</strong><br>
<font color="#FF0000">第一页</font> <a href="day2_1.html">实现有效性</a><br>
<font color="#FF0000">第二页</font> DTD的完整例子<br>
<font color="#FF0000">第三页</font> <a href="day2_3.html">XML的未来</a></p>
<p>[<a href="day1_1.html">第1天</a>][第2天]</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 + -