<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_范晨鹏的博客</title><subtitle type="text"/><id>http://feed.cnblogs.com/blog/u/19101/rss</id><updated>2011-11-09T13:29:18Z</updated><author><name>范晨鹏</name><uri>http://www.cnblogs.com/diylab/</uri></author><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/diylab/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/19101/rss"/><entry><id>http://www.cnblogs.com/diylab/archive/2011/11/09/2243649.html</id><title type="text">excel中对比不一致的名单</title><summary type="text">方案1：使用 match函数1、在表头插入一列，粘贴姓名。2、在表头插入一列，在第一行输入=match(b1,c:c,0)3、拖放第一行单元格的内容直到最后一行。4、筛选 #n/a数据。如何解决重名问题？1、插入新列并用 &amp; 连接多个字段。议案2：使用 msquery</summary><published>2011-11-09T13:23:00Z</published><updated>2011-11-09T13:23:00Z</updated><author><name>范晨鹏</name><uri>http://www.cnblogs.com/diylab/</uri></author><link rel="alternate" href="http://www.cnblogs.com/diylab/archive/2011/11/09/2243649.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/diylab/archive/2011/11/09/2243649.html"/><content type="html">&lt;div&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "ca-pub-7975480960333187";/* diylabnews */google_ad_slot = "6056769485";google_ad_width = 300;google_ad_height = 250;//--&gt;&lt;/script&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;p&gt;&lt;span style="font-family: 宋体"&gt;方案&lt;/span&gt;1&lt;span style="font-family: 宋体"&gt;：使用&lt;/span&gt; match&lt;span style="font-family: 宋体"&gt;函数&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;1、&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 宋体"&gt;在表头插入一列，粘贴姓名。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;2、&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 宋体"&gt;在表头插入一列，在第一行输入&lt;/span&gt;=match(b1,c:c,0)&lt;/p&gt;&lt;p&gt;&lt;span&gt;3、&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 宋体"&gt;拖放第一行单元格的内容直到最后一行。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;4、&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 宋体"&gt;筛选&lt;/span&gt; #n/a&lt;span style="font-family: 宋体"&gt;数据。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 宋体"&gt;如何解决重名问题？&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;1、&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 宋体"&gt;插入新列并用&lt;/span&gt; &amp;amp; &lt;span style="font-family: 宋体"&gt;连接多个字段。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: 宋体"&gt;议案&lt;/span&gt;2&lt;span style="font-family: 宋体"&gt;：使用&lt;/span&gt; msquery&lt;/p&gt;&lt;img src="http://www.cnblogs.com/diylab/aggbug/2243649.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/diylab/archive/2011/11/09/2243649.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/diylab/archive/2011/11/09/2243647.html</id><title type="text">word中格式化姓名的输出</title><summary type="text">要求：将花名册.xls中“优秀工作者”工作表中的所有姓名粘贴在word中，要求每行依次显示5个姓名，姓名之间间隔一个字。两个字的姓名要与三个字的姓名等宽显示。字体：三号仿宋gb2312。这些名单需要在word,excel中自由粘贴。可用格式化替换来完成。前置工作：页面设置-&gt;文档网络-&gt;勾选“指定行和文字网格”。点击“字体设置”按钮，设置字号为3号。1、将姓名之间的空格替换为制表符。2、将段落缩进调整为左右缩进2.5个字符。3、查找&lt;??&gt;，以将两个字的姓名替换为加宽字符。4、查找?&gt;，格式为加宽的字符，替换为不加宽的字符。</summary><published>2011-11-09T13:21:00Z</published><updated>2011-11-09T13:21:00Z</updated><author><name>范晨鹏</name><uri>http://www.cnblogs.com/diylab/</uri></author><link rel="alternate" href="http://www.cnblogs.com/diylab/archive/2011/11/09/2243647.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/diylab/archive/2011/11/09/2243647.html"/><content type="html">&lt;div&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "ca-pub-7975480960333187";/* diylabnews */google_ad_slot = "6056769485";google_ad_width = 300;google_ad_height = 250;//--&gt;&lt;/script&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp; &lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-size: 12pt; font-family: 宋体"&gt;要求：将花名册.xls中&amp;#8220;优秀工作者&amp;#8221;工作表中的所有姓名粘贴在word中，要求每行依次显示5个姓名，姓名之间间隔一个字。两个字的姓名要与三个字的姓名等宽显示。字体：三号仿宋gb2312。这些名单需要在word,excel中自由粘贴。&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-size: 12pt; font-family: 宋体"&gt;可用格式化替换来完成。&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-size: 12pt; font-family: 宋体"&gt;前置工作：页面设置-&amp;gt;文档网络-&amp;gt;勾选&amp;#8220;指定行和文字网格&amp;#8221;。点击&amp;#8220;字体设置&amp;#8221;按钮，设置字号为3号。&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-size: 12pt; font-family: 宋体"&gt;1&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: 宋体"&gt;、将姓名之间的空格替换为制表符。&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-size: 12pt; font-family: 宋体"&gt;2&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: 宋体"&gt;、将段落缩进调整为左右缩进2.5个字符。&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-size: 12pt; font-family: 宋体"&gt;3&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: 宋体"&gt;、查找&amp;lt;??&amp;gt;，以将两个字的姓名替换为加宽字符。&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-size: 12pt; font-family: 宋体"&gt;&lt;img alt="" src="http://images.cnblogs.com/cnblogs_com/diylab/格式化替换.png" border="0" longdesc="" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;span style="font-size: 12pt; font-family: 宋体"&gt;4&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: 宋体"&gt;、查找?&amp;gt;，格式为加宽的字符，替换为不加宽的字符。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/diylab/aggbug/2243647.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/diylab/archive/2011/11/09/2243647.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/diylab/archive/2011/10/22/2221139.html</id><title type="text">教育部老师远程培训课程听课点击器</title><summary type="text">/Files/diylab/tttt.zip该软件实现的功能是：每隔660秒点击指定的网页上id 为timeupdate的元素。用法：1、打开课程页面。2、 拖动软件的靶子图标到课程窗口。这时窗口周围会显示一个黑框框。3、点击“启动定时器”。为媳妇写的。勉强能用，问题很多。懒得完善了。过几天把源码传上来。</summary><published>2011-10-22T05:56:00Z</published><updated>2011-10-22T05:56:00Z</updated><author><name>范晨鹏</name><uri>http://www.cnblogs.com/diylab/</uri></author><link rel="alternate" href="http://www.cnblogs.com/diylab/archive/2011/10/22/2221139.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/diylab/archive/2011/10/22/2221139.html"/><content type="html">&lt;p&gt;&lt;a href="http://files.cnblogs.com/diylab/tttt.zip"&gt;/Files/diylab/tttt.zip&lt;/a&gt;&lt;/p&gt;&lt;p&gt;该软件实现的功能是：每隔660秒点击指定的网页上id 为&amp;nbsp;timeupdate&amp;nbsp;的元素。&lt;/p&gt;&lt;p&gt;用法：&lt;/p&gt;&lt;p&gt;1、打开课程页面。&lt;/p&gt;&lt;p&gt;2、 拖动软件的靶子图标到课程窗口。这时窗口周围会显示一个黑框框。&lt;/p&gt;&lt;p&gt;3、点击&amp;#8220;启动定时器&amp;#8221;。&lt;/p&gt;&lt;p&gt;为媳妇写的。勉强能用，问题很多。懒得完善了。过几天把源码传上来。&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/diylab/aggbug/2221139.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/diylab/archive/2011/10/22/2221139.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/diylab/archive/2011/10/21/2220858.html</id><title type="text">office单位换算速查表</title><summary type="text">英寸 十二点活字(PICA) 毫米(millimeter) 磅(point) 5 30 127 360 1 6 25.4 72 0.166666667...</summary><published>2011-10-21T15:49:00Z</published><updated>2011-10-21T15:49:00Z</updated><author><name>范晨鹏</name><uri>http://www.cnblogs.com/diylab/</uri></author><link rel="alternate" href="http://www.cnblogs.com/diylab/archive/2011/10/21/2220858.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/diylab/archive/2011/10/21/2220858.html"/><content type="html">&lt;div&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "ca-pub-7975480960333187";/* diylabnews */google_ad_slot = "6056769485";google_ad_width = 300;google_ad_height = 250;//--&gt;&lt;/script&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;table x:str="" border="1px" cellpadding="0" cellspacing="0" width="506"&gt;     &lt;tbody&gt;         &lt;tr&gt;             &lt;td&gt;英寸&lt;/td&gt;             &lt;td&gt;十二点活字(PICA)&lt;/td&gt;             &lt;td&gt;毫米(millimeter)&lt;/td&gt;             &lt;td&gt;磅(point)&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;             &lt;td&gt;5&lt;/td&gt;             &lt;td&gt;30&lt;/td&gt;             &lt;td&gt;127&lt;/td&gt;             &lt;td&gt;360&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;             &lt;td&gt;1&lt;/td&gt;             &lt;td&gt;6&lt;/td&gt;             &lt;td&gt;25.4&lt;/td&gt;             &lt;td&gt;72&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;             &lt;td&gt;0.166666667&lt;/td&gt;             &lt;td&gt;1&lt;/td&gt;             &lt;td&gt;4.233333333&lt;/td&gt;             &lt;td&gt;12&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;             &lt;td&gt;0.039370079&lt;/td&gt;             &lt;td&gt;0.236220472&lt;/td&gt;             &lt;td&gt;1&lt;/td&gt;             &lt;td&gt;2.834645669&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;             &lt;td&gt;0.013888889&lt;/td&gt;             &lt;td&gt;0.083333333&lt;/td&gt;             &lt;td&gt;0.352777778&lt;/td&gt;             &lt;td&gt;1&lt;/td&gt;         &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 宋体; line-height: 24px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "&gt;磅&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 汉字字号&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family: 宋体; font-size: 14px; line-height: 24px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "&gt;42&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 初号&lt;br /&gt;36&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 小初&lt;br /&gt;26&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 一号&lt;br /&gt;24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 小一&lt;br /&gt;22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 二号&lt;br /&gt;18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 小二&lt;br /&gt;16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 三号&lt;br /&gt;15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 小三&lt;br /&gt;14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 四号&lt;br /&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 小四&lt;br /&gt;10.5&amp;nbsp;&amp;nbsp;&amp;nbsp; 五号&lt;br /&gt;9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 小五&lt;br /&gt;7.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 六号&lt;br /&gt;6.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 小六&lt;br /&gt;5.5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 七号&lt;br /&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 八号&lt;/span&gt;&lt;p&gt;相关链接：&lt;/p&gt;&lt;div style="display: inline-block; "&gt;&lt;/div&gt;&lt;a href="http://support.microsoft.com/kb/76388/en-us"&gt;http://support.microsoft.com/kb/76388/en-us&lt;/a&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: Arial, Verdana, Tahoma, sans-serif; font-size: 12px; line-height: normal; "&gt;&lt;/span&gt;&lt;h1 class="title" style="font-size: 17px; margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; font-family: Arial, Verdana, Tahoma, sans-serif; line-height: normal; "&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;微软office文章：Relationship Between Inches, Picas, Points, Pitch, and Twips&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://tieba.baidu.com/f?kz=808639513"&gt;http://tieba.baidu.com/f?kz=808639513&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 宋体; line-height: 32px; "&gt;关于字号与磅值的专业解答&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Verdana, Tahoma, sans-serif; font-size: 12px; line-height: normal; "&gt;&lt;/span&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Verdana, Tahoma, sans-serif; font-size: 12px; line-height: normal; "&gt;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/diylab/aggbug/2220858.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/diylab/archive/2011/10/21/2220858.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/diylab/archive/2011/10/21/2220746.html</id><title type="text">excel 中制作刻度尺</title><summary type="text">excel 中设定每一个单元格的宽度为1mm，以单元格的上下边框做刻度，便可做出 1mm的宽度。要设置单位格的高度，只需要将excel行标题上右击，选“行高”，在弹出的对话框内填入2.834645669。为什么是2.834645669呢？excel的行高的计量单位是磅(point )，根据office单位速查表，得知，1mm=2.834645669 point你也看出来喽，我们制作的刻度表不是那么精确。 每500米会少1mm。对于精确到mm的刻度尺来说，这样的误差是可以忽略的。附件： 刻度尺使用列宽行不行呢？呃~~可以，但计算起来来复杂一些。你可以参考EXCEL 中行高列宽的计量单位 来计算。</summary><published>2011-10-21T14:05:00Z</published><updated>2011-10-21T14:05:00Z</updated><author><name>范晨鹏</name><uri>http://www.cnblogs.com/diylab/</uri></author><link rel="alternate" href="http://www.cnblogs.com/diylab/archive/2011/10/21/2220746.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/diylab/archive/2011/10/21/2220746.html"/><content type="html">&lt;div&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "ca-pub-7975480960333187";/* diylabnews */google_ad_slot = "6056769485";google_ad_width = 300;google_ad_height = 250;//--&gt;&lt;/script&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;p&gt;excel 中设定每一个单元格的宽度为1mm，以单元格的上下边框做刻度，便可做出 1mm的宽度。&lt;/p&gt;&lt;p&gt;要设置单位格的高度，只需要将excel行标题上右击，选&amp;#8220;行高&amp;#8221;，在弹出的对话框内填入2.834645669。&lt;/p&gt;&lt;p&gt;为什么是2.834645669呢？excel的行高的计量单位是磅(&amp;nbsp;point )，根据&lt;a href="http://www.cnblogs.com/diylab/archive/2011/10/21/2220858.html"&gt;office单位速查表&lt;/a&gt;，得知，1mm=2.834645669 point&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;你也看出来喽，我们制作的刻度表不是那么精确。 每500米会少1mm。对于精确到mm的刻度尺来说，这样的误差是可以忽略的。&lt;/p&gt;&lt;p&gt;附件： &lt;a href="http://files.cnblogs.com/diylab/刻度尺3.xls"&gt;刻度尺&lt;/a&gt;&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;使用列宽行不行呢？呃~~可以，但计算起来来复杂一些。你可以参考&lt;a title="EXCEL 中行高列宽的计量单位 &amp;#13;&amp;#10;" href="http://blog.5d.cn/user8/the-one-rong/200805/484323.html"&gt;EXCEL 中行高列宽的计量单位 &lt;/a&gt;来计算。这个文章是以 excel2003为例说的。在 excel2007中，设置默认字体的方法是： 开始按钮－&amp;gt;准备-&amp;gt;excel选项-&amp;gt;常规。&lt;/p&gt;&lt;p&gt;当然，使用列宽要复杂多了，而且可移植性不好。&lt;/p&gt;&lt;p&gt;相关链接：&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.translatorscafe.com/cafe/units-converter/length/c/"&gt;http://www.translatorscafe.com/cafe/units-converter/length/c/&lt;/a&gt;&amp;nbsp; &amp;nbsp;提供长度换算服务。&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/diylab/aggbug/2220746.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/diylab/archive/2011/10/21/2220746.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/diylab/archive/2011/09/21/2184296.html</id><title type="text">用excel数据批量填充word表格</title><summary type="text">word表格是一种制式文档。所谓制式文档，指文档的主体部分内容或格式固定，而称呼、签名等内容不同的文档。在文档数量较多时，手动输入是件很费神的事情。word的 邮件合并 功能可以帮我们轻松地把excel中的数据逐条填充到 word相应的位置，批量生成全部的文档。以下用office 2003为例，说明此功能。1、 准备好要批量填充的word文档和包含数据的 excel文档。2、在菜单栏点击“工具”-&gt;“信函与邮件”-&gt;“邮件合并”，开始执行邮件合并向导。共六步操作。第三步“选取收件人”即选定数据所在的 excel 工作表。第四步“撰写信函”将工作表中的字段绑定在word的相应位置。输</summary><published>2011-09-21T09:50:00Z</published><updated>2011-09-21T09:50:00Z</updated><author><name>范晨鹏</name><uri>http://www.cnblogs.com/diylab/</uri></author><link rel="alternate" href="http://www.cnblogs.com/diylab/archive/2011/09/21/2184296.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/diylab/archive/2011/09/21/2184296.html"/><content type="html">&lt;div&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "ca-pub-7975480960333187";/* diylabnews */google_ad_slot = "6056769485";google_ad_width = 300;google_ad_height = 250;//--&gt;&lt;/script&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;p&gt;&lt;span class="Apple-style-span"&gt;word表格是一种制式文档。所谓制式文档，指文档的主体部分内容或格式固定，而称呼、签名等内容不同的文档。在文档数量较多时，手动输入是件很费神的事情。word的 邮件合并 功能可以帮我们轻松地把excel中的数据逐条填充到 word相应的位置，批量生成全部的文档。&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: center" align="center"&gt;&lt;img alt="" src="http://images.cnblogs.com/cnblogs_com/diylab/0000.png" /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 32pt; mso-char-indent-count: 2.0"&gt;&lt;span&gt;以下用&lt;span lang="EN-US"&gt;office 2003&lt;/span&gt;为例，说明此功能。&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 0cm; text-indent: 0cm; mso-list: l0 level1 lfo1; tab-stops: list 0cm"&gt;&lt;span lang="EN-US" style="font-size: 16pt; font-family: 仿宋_GB2312; mso-bidi-font-family: 仿宋_GB2312"&gt;&lt;span style="mso-list: Ignore"&gt;1、&lt;span style="font: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 16pt; font-family: 仿宋_GB2312"&gt;准备好要批量填充的&lt;span lang="EN-US"&gt;word&lt;/span&gt;文档和包含数据的&lt;span lang="EN-US"&gt; excel&lt;/span&gt;文档。&lt;span lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: center" align="center"&gt;&lt;img alt="" src="http://images.cnblogs.com/cnblogs_com/diylab/001.png" /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 0cm; text-indent: 0cm; mso-list: l0 level1 lfo1; tab-stops: list 0cm"&gt;2、&lt;span style="font-family: 仿宋_GB2312"&gt;在菜单栏点击&amp;#8220;工具&amp;#8221;-&amp;gt;&amp;#8220;信函与邮件&amp;#8221;-&amp;gt;&amp;#8220;邮件合并&amp;#8221;，开始执行邮件合并向导。共六步操作。&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: center" align="center"&gt;&lt;img alt="" src="http://images.cnblogs.com/cnblogs_com/diylab/002.png" /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;第三步&amp;#8220;选取收件人&amp;#8221;即选定数据所在的 excel 工作表。&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: center" align="center"&gt;&lt;img alt="" src="http://images.cnblogs.com/cnblogs_com/diylab/003.png" /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;第四步&amp;#8220;撰写信函&amp;#8221;将工作表中的字段绑定在word的相应位置。&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: center" align="center"&gt;&lt;img alt="" src="http://images.cnblogs.com/cnblogs_com/diylab/004.png" /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: center" align="center"&gt;&lt;img alt="" src="http://images.cnblogs.com/cnblogs_com/diylab/005.png" /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: center" align="center"&gt;&lt;img alt="" src="http://images.cnblogs.com/cnblogs_com/diylab/006.png" /&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;输出结果到word文档。操作将原来的格式化文档复制 N份并以excel中的记录填充，以分页符分隔。&lt;/span&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/diylab/aggbug/2184296.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/diylab/archive/2011/09/21/2184296.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/diylab/archive/2011/07/22/2113416.html</id><title type="text">cpuid.com</title><summary type="text">http://www.cpuid.com/softwares/cpu-z.html#whatiscpuzWhat is CPU-ZCPU-Zis a freeware that gathers information on some of the main devices of your system.CPUName and number.Core stepping and process.Package.Core voltage.Internal and external clocks, clock multiplier.Supported instruction sets.Cache in</summary><published>2011-07-21T16:25:00Z</published><updated>2011-07-21T16:25:00Z</updated><author><name>范晨鹏</name><uri>http://www.cnblogs.com/diylab/</uri></author><link rel="alternate" href="http://www.cnblogs.com/diylab/archive/2011/07/22/2113416.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/diylab/archive/2011/07/22/2113416.html"/><content type="html">&lt;p&gt;&lt;a href="http://www.cpuid.com/softwares/cpu-z.html#whatiscpuz"&gt;http://www.cpuid.com/softwares/cpu-z.html#whatiscpuz&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 19px; "&gt;&lt;p&gt;&lt;strong&gt;What is CPU-Z&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;CPU-Z&lt;/strong&gt;&amp;nbsp;is a freeware that gathers information on some of the main devices of your system.&lt;/p&gt;&lt;strong style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;CPU&lt;/strong&gt;&lt;br style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;ul style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; display: block; float: left; width: 724px; line-height: 1.6em; color: #333333; "&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Name and number.&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Core stepping and process.&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Package.&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Core voltage.&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Internal and external clocks, clock multiplier.&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Supported instruction sets.&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Cache information.&lt;/li&gt;&lt;/ul&gt;&lt;strong style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Mainboard&lt;/strong&gt;&lt;br style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;ul style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; display: block; float: left; width: 724px; line-height: 1.6em; color: #333333; "&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Vendor, model and revision.&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;BIOS model and date.&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Chipset (northbridge and southbridge) and sensor.&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Graphic interface.&lt;/li&gt;&lt;/ul&gt;&lt;strong style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Memory&lt;/strong&gt;&lt;br style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;ul style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; display: block; float: left; width: 724px; line-height: 1.6em; color: #333333; "&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Frequency and timings.&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Module(s) specification using SPD (Serial Presence Detect) : vendor, serial number, timings table.&lt;/li&gt;&lt;/ul&gt;&lt;strong style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;System&lt;/strong&gt;&lt;br style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /&gt;&lt;ul style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 10px; padding-left: 0px; display: block; float: left; width: 724px; line-height: 1.6em; color: #333333; "&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 14px; display: list-item; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://www.cpuid.com/medias/images/list-dot.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 3px 6px; background-repeat: no-repeat no-repeat; "&gt;Windows and DirectX version.&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/diylab/aggbug/2113416.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/diylab/archive/2011/07/22/2113416.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/diylab/archive/2011/07/20/2112255.html</id><title type="text">ppurl.com</title><summary type="text">Computer Vision : Algorithms and Applications » 电子书下载» - 皮皮书屋</summary><published>2011-07-20T15:57:00Z</published><updated>2011-07-20T15:57:00Z</updated><author><name>范晨鹏</name><uri>http://www.cnblogs.com/diylab/</uri></author><link rel="alternate" href="http://www.cnblogs.com/diylab/archive/2011/07/20/2112255.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/diylab/archive/2011/07/20/2112255.html"/><content type="html">&lt;a class="l" href="http://www.ppurl.com/2011/03/computer-vision-algorithms-and-applications.html" target="_blank"&gt;&lt;font color="#551a8b" size="2"&gt;Computer Vision : Algorithms and Applications &amp;#187; 电子书下载&amp;#187; - 皮皮书屋&lt;/font&gt;&lt;/a&gt;&lt;img src="http://www.cnblogs.com/diylab/aggbug/2112255.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/diylab/archive/2011/07/20/2112255.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/diylab/archive/2011/05/10/2042401.html</id><title type="text">expat 编程入门</title><summary type="text">expat 是一款高性能的 xml 解析工具包。出自名家James Clark 之手。firefox 就是使用了 expat 作为 html解析器。expat有优异的性能表现，能比其它的解析器快 1倍到几十倍，视解析器的语言不同。expat 是使用面向数据流的解析。这不同于 dom的解析方式。面向数据流的解析的一个显著优点是： 可以在读入整个文档之前进行解析。这在处理大型文档和流式文件时（例如网页）尤其有用。 expat 针对数据流的解析做了很多细节的处理，比如，可以暂停/恢复解析。 开始学习 expat，你只需要掌握三个 api:1XML_ParserXML_ParserCreate(con</summary><published>2011-05-10T11:18:00Z</published><updated>2011-05-10T11:18:00Z</updated><author><name>范晨鹏</name><uri>http://www.cnblogs.com/diylab/</uri></author><link rel="alternate" href="http://www.cnblogs.com/diylab/archive/2011/05/10/2042401.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/diylab/archive/2011/05/10/2042401.html"/><content type="html">&lt;p&gt;expat 是一款高性能的 xml 解析工具包。出自名家&amp;nbsp;&lt;span class="Apple-style-span" style="color: #222222; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: normal; "&gt;&amp;nbsp;James Clark 之手。&lt;/span&gt;firefox 就是使用了 expat 作为 html解析器。expat有优异的性能表现，&lt;font class="Apple-style-span" color="#222222" face="verdana, arial, helvetica, sans-serif"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: normal; "&gt;能&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: normal; "&gt;&lt;a href="http://www.xml.com/pub/a/Benchmark/article.html?page=3" target="_blank"&gt;比其它的解析器快 1倍到几十倍，视解析器的语言不同&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: normal; "&gt;。expat 是使用面向数据流的解析。这不同于 dom的解析方式。面向数据流的解析的一个显著优点是： 可以在读入整个文档之前进行解析。这在处理大型文档和流式文件时（例如网页）尤其有用。 expat 针对数据流的解析做了很多细节的处理，比如，可以暂停/恢复解析。&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;div&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "ca-pub-7975480960333187";/* diylabnews */google_ad_slot = "6056769485";google_ad_width = 300;google_ad_height = 250;//--&gt;&lt;/script&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;/div&gt; &lt;p&gt;开始学习 expat，你只需要掌握三个&lt;a href="http://www.xml.com/pub/a/1999/09/expat/reference.html" target="_blank"&gt; api&lt;/a&gt;:&lt;/p&gt;&lt;p&gt;&lt;font class="Apple-style-span" color="#800080" face="'Courier New'" size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding:10px;"&gt;&lt;div&gt;&lt;font class="Apple-style-span" color="#800080" face="'Courier New'" size="2"&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;XML_Parser&amp;nbsp;XML_ParserCreate(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;const&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;XML_Char&lt;/span&gt;&lt;span style="color: #000000;"&gt;*&lt;/span&gt;&lt;span style="color: #000000;"&gt;encoding)&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;构造一个新的解析器。&lt;/p&gt;&lt;p&gt;&lt;font class="Apple-style-span" face="'Courier New'" size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding:10px;"&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="'Courier New'" size="2"&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;XML_SetElementHandler(XML_Parser&amp;nbsp;p,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XML_StartElementHandler&amp;nbsp;start,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XML_EndElementHandler&amp;nbsp;end);&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp; 注册一个处理器&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding:10px;"&gt;&lt;div&gt;&lt;span style="color: #800080;"&gt;3&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;XML_Parse(XML_Parser&amp;nbsp;p,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;const&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;char&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;*&lt;/span&gt;&lt;span style="color: #000000;"&gt;s,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;len,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;isFinal)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; 解析 xml 数据流&lt;/p&gt;&lt;p&gt;在下面的例子中，我们要捕获一段 html 代码中的 链接( &amp;lt;a&amp;gt; ) 标签。&lt;/p&gt;&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding:10px;"&gt;&lt;div&gt;&lt;span style="color: #008080;"&gt;&amp;nbsp;1&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;expat.h&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;&amp;nbsp;2&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;stdio.h&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;&amp;nbsp;3&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;#include&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt;.h&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;&amp;nbsp;4&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;char&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;strhtml[]&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;{&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;a&amp;nbsp;target=&amp;nbsp;\"_blank\"&amp;nbsp;href=\"www.labfan.com\"&amp;gt;&amp;nbsp;this&amp;nbsp;is&amp;nbsp;labfan&amp;lt;/a&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;};&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;&amp;nbsp;5&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;href_begin_handler&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;*&lt;/span&gt;&lt;span style="color: #000000;"&gt;userData,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;const&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;XML_Char&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;*&lt;/span&gt;&lt;span style="color: #000000;"&gt;name,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;const&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;XML_Char&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;**&lt;/span&gt;&lt;span style="color: #000000;"&gt;atts)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;&amp;nbsp;6&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;&amp;nbsp;7&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;index&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;&amp;nbsp;8&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;(strcmp(&amp;nbsp;name,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #800000;"&gt;a&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;)&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;&amp;nbsp;9&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;10&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;nbsp;I&amp;nbsp;get&amp;nbsp;the&amp;nbsp;node&amp;nbsp;a&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;11&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;while&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;(&amp;nbsp;atts[index]&amp;nbsp;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;12&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;13&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;(&amp;nbsp;strcmp(&amp;nbsp;atts[index],&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #800000;"&gt;href&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;)&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;14&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;15&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #800000;"&gt;this&amp;nbsp;auch&amp;nbsp;link&amp;nbsp;to:&amp;nbsp;&amp;nbsp;%s\n&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #000000;"&gt;,&amp;nbsp;atts[index&lt;/span&gt;&lt;span style="color: #000000;"&gt;+&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;]&amp;nbsp;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;16&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;break&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;17&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;18&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;index&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;+=&lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;19&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;20&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;21&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;22&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;23&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;main()&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;24&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;25&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XML_Parser&amp;nbsp;parser;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;26&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt;(&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;!&lt;/span&gt;&lt;span style="color: #000000;"&gt;(&amp;nbsp;parser&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;strong&gt;XML_ParserCreate&lt;/strong&gt;(&amp;nbsp;NULL&amp;nbsp;)&amp;nbsp;)&amp;nbsp;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;27&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;28&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #800000;"&gt;bad&amp;nbsp;praser\n&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;29&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;30&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;XML_SetElementHandler&lt;/strong&gt;(&amp;nbsp;parser,&amp;nbsp;href_begin_handler,&amp;nbsp;NULL&amp;nbsp;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;31&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;(&amp;nbsp;XML_STATUS_ERROR&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&lt;strong&gt;XML_Parse&lt;/strong&gt;(&amp;nbsp;parser,&amp;nbsp;strhtml,&amp;nbsp;strlen(&amp;nbsp;strhtml&amp;nbsp;),&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;)&amp;nbsp;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;32&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;33&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #800000;"&gt;failed to parser: %s( line:%d, column:%d )\n&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #000000;"&gt;, XML_ErrorString( XML_GetErrorCode( parser ) ),&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;34&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style="color: #000000;"&gt;XML_GetCurrentLineNumber( parser ), XML_GetCurrentColumnNumber( parser ));&lt;/span&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;35&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style="color: #0000FF;"&gt;return&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000;"&gt;-&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;36&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008080;"&gt;37 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #008080;"&gt;38&lt;/span&gt;&amp;nbsp;&lt;span style="color: #000000;"&gt;}&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;代码运行结果：&lt;/p&gt;&lt;div back_ground_color="#000000"&gt;&lt;p&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;I&amp;nbsp;get&amp;nbsp;the&amp;nbsp;node&amp;nbsp;a&amp;nbsp;this&amp;nbsp;auch&amp;nbsp;link&amp;nbsp;to:&amp;nbsp;&amp;nbsp;www.labfan.com&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;代码解释：&lt;/p&gt;&lt;p&gt;&amp;nbsp;如前所述，我们使用三个函数来获得需要的结果。&lt;/p&gt;&lt;p&gt;&amp;nbsp;第 26 行用&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="font-family: 'Courier New'; color: #000000; "&gt;&lt;strong&gt;XML_ParserCreate&lt;/strong&gt;(&amp;nbsp;NULL&amp;nbsp;) 创建一个解析器。 参数 NULL 表示不指派字符集( 只有 ascii字符 )。 你也可以指定其它的字符集。expat 内置支持的字符集有四种:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style="color: #222222; font-family: verdana, arial, helvetica, sans-serif; font-size: 12px; line-height: normal; "&gt;&lt;ul style="padding-left: 25px; list-style-image: none; "&gt;     &lt;li style="font-size: 11px; color: #222222; "&gt;UTF-8&lt;/li&gt;     &lt;li style="font-size: 11px; color: #222222; "&gt;UTF-16&lt;/li&gt;     &lt;li style="font-size: 11px; color: #222222; "&gt;ISO-8859-1&lt;/li&gt;     &lt;li style="font-size: 11px; color: #222222; "&gt;US-ASCII&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;第 30 行&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;strong&gt;XML_SetElementHandler&lt;/strong&gt;(&amp;nbsp;parser,&amp;nbsp;href_begin_handler,&amp;nbsp;NULL&amp;nbsp;) 为前面创建的解析器 parser 注册 element handler。 第二个参数&amp;nbsp;&lt;/span&gt;href_begin_handler 是在进入结点的时候执行。第三个参数在退出 element 的时候执行。&lt;/p&gt;&lt;p&gt;第 31 行&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px; "&gt;&lt;span style="font-family: 'Courier New'; color: #000000; "&gt;&lt;strong&gt;XML_Parse&lt;/strong&gt;(&amp;nbsp;parser,&amp;nbsp;strhtml,&amp;nbsp;strlen(&amp;nbsp;strhtml&amp;nbsp;),&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: #800080; "&gt;0&lt;/span&gt;&lt;span style="font-family: 'Courier New'; color: #000000; "&gt;&amp;nbsp;) 为 parser 指派实际要处理的字串。第二个参数 strhtml 和第三个参数分别是要处理的字串的首地址和字符串长度。 第四个参数？&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;相关链接：&lt;/p&gt;&lt;p&gt;1、&lt;a href="http://www.xml.com/pub/a/1999/09/expat/index.html"&gt;using expat&amp;nbsp;&lt;/a&gt;&amp;nbsp; 是&lt;a href="http://www.libexpat.org/" target="_blank"&gt;expat 官网&lt;/a&gt;提供的一个教程的链接。&lt;/p&gt;&lt;p&gt;2、&amp;nbsp;&lt;a href="http://www.xml.com/pub/a/Benchmark/article.html" target="_blank"&gt;Benchmarking XML Parsers&lt;/a&gt; 对六款 xml parser 做了基准测试。&lt;/p&gt;&lt;p&gt;3、&lt;a href="http://www.xml.com/pub/a/1999/09/expat/reference.html" target="_blank"&gt;expat API 参考&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/diylab/aggbug/2042401.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/diylab/archive/2011/05/10/2042401.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/diylab/archive/2011/05/10/473874.html</id><title type="text">二叉树先根序、后根序、中根序遍历的速算法（解题技巧）</title><summary type="text">已知二叉树的先/后根序遍历和中根序遍历可唯一确定一棵二叉树，数据结构试题中常有已知先(后)根序遍历要求确定后（先）根序遍历题型。一般的，我们要按照已知的条件把二叉树画出来，再按图写出结果。这样麻烦的事常让我感到混乱而不得不出错。经过研究我找出了一种不用画图，由先（后）根序遍历和中根序遍历迅速确定遍历结果的办法。谨以此文献给智商与我同级而又不得不研究算法的朋友。抽象思维太差，用例子来说明吧。下面这个是后根遍历的算法。例1：已知某二叉树的先根序遍历为ABCDEFG,中根序遍历为CDBAFEG，则它的后根序遍历为_________解法如下：1、确定树根。由先序遍历知道，树根为A。2、分离左、右子树.</summary><published>2011-05-10T08:20:00Z</published><updated>2011-05-10T08:20:00Z</updated><author><name>范晨鹏</name><uri>http://www.cnblogs.com/diylab/</uri></author><link rel="alternate" href="http://www.cnblogs.com/diylab/archive/2011/05/10/473874.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/diylab/archive/2011/05/10/473874.html"/><content type="html">&lt;p&gt;已知二叉树的先/后根序遍历和中根序遍历可唯一确定一棵二叉树，数据结构试题中常有已知先(后)根序遍历要求确定后（先）根序遍历题型。一般的，我们要按照已知的条件把二叉树画出来，再按图写出结果。这样麻烦的事常让我感到混乱而不得不出错。经过研究我找出了一种不用画图，由先（后）根序遍历和中根序遍历迅速确定遍历结果的办法。谨以此文献给智商与我同级而又不得不研究算法的朋友。&lt;br /&gt;抽象思维太差，用例子来说明吧。下面这个是后根遍历的算法。&lt;br /&gt;&lt;div&gt;&lt;script type="text/javascript"&gt;&lt;!--google_ad_client = "ca-pub-7975480960333187";/* diylabnews */google_ad_slot = "6056769485";google_ad_width = 300;google_ad_height = 250;//--&gt;&lt;/script&gt;&lt;script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;&lt;/div&gt;例1：已知某二叉树的先根序遍历为ABCDEFG,中根序遍历为CDBAFEG，则它的后根序遍历为_________&lt;br /&gt;解法如下：&lt;br /&gt;1、确定树根。由先序遍历知道，树根为A。&lt;br /&gt;2、分离左、右子树。由中根序遍历知，A左面的为CDB左子树结点，右面的FEG为右子树结点。&lt;br /&gt;把先根序遍历也分成左、右子树结点，BCD、EFG。&lt;br /&gt;&lt;/p&gt;&lt;div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"&gt;&lt;span style="color: #000000"&gt;&lt;font style="background-color: #eeeeee"&gt;&lt;/font&gt;前根序遍历　BCD&amp;nbsp;EFG&lt;br /&gt;中根序遍历　CDB&amp;nbsp;FEG&lt;br /&gt;&lt;img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;3、分别把先根序遍历左、右子树结点抄过来，写的时候要从右往左写，本例中，依次写下B、C、D、，E、F、G，结果是DCB GFE。&lt;br /&gt;当然不是简单到这种程序。上面只是个原理。抄的过程应该是这样的：盯着前根序的，瞅着中根序的。如果要抄的先根序中的结点在中根序中是最左/右边，则直接抄过来；如果不是，则把这个结点左边的结点先放记在右根序的最左边，然后继续抄。本题的结果是DCB,FGE,A, 即DCBFGEA。&lt;br /&gt;上面这个例子太短，看不出&amp;#8220;猫腻&amp;#8221;来。再举个结点多一点儿的。&lt;br /&gt;&amp;nbsp;例2：已知某二叉树的先根序遍历为ABCDEFGHIJK,中根序遍历为CEDFBAHKJIG，则它的后根序遍历为_________&lt;br /&gt;&amp;nbsp;按上面的方法：&lt;/p&gt;&lt;div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"&gt;&lt;img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="" /&gt;&lt;span style="color: #000000"&gt;前根序遍历　BCDEF&amp;nbsp; GHIJK&lt;br /&gt;&lt;img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="" /&gt;中根序遍历　CEDFB &amp;nbsp;HKJIG&lt;img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align="top" alt="" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;依次抄得前根序的结点：F、E(E在中根序遍历中不靠边，所以先放在后根遍序历中左子树结点最左边)、D、C&lt;br /&gt;同理，把右子树也抄过来。因此，写下结点的过程依次是：&lt;br /&gt;&lt;br /&gt;如果还是不太懂，你可以试着做一下下面的例子：&lt;br /&gt;已知二叉树前序遍历 ABCDEFGHIJK，中序遍历 CEDFBAHGKJI，求后序遍历。&lt;br /&gt;解：(1)以根结点A分左、右子树结点，&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BCDEF GHIJK&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CEDFB HGKJI&lt;br /&gt;(2)　写左子树，盯着前序，从右到左开始写&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DCB　（在中序中，B靠右边，C靠左边，D不靠边。写一个，从中序中抹一个。）&lt;br /&gt;&lt;br /&gt;因为D在中序遍历中不靠边，所以下一个结点E先搁到最左边（注意，是&amp;#8220;搁&amp;#8221;，也就是说，不能把E从中序抹去。&lt;br /&gt;E&amp;nbsp; &amp;nbsp; DCB&lt;br /&gt;因为B已经抹了，F靠右边。于是F仍然按照从右到左的规则，写在D的的左边。&lt;br /&gt;E　FDCB&lt;br /&gt;最后把E加上，左子树OK。&lt;br /&gt;右子树仍然从右到写&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; G&lt;br /&gt;因为G不靠边，所以下一个结点H先搁在最左边&lt;br /&gt;H&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; G&lt;br /&gt;&amp;nbsp;然后继续&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; H&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KJIG&lt;br /&gt;于是，结果是&lt;br /&gt;EFDCBHKJIGA　&lt;br /&gt;&amp;nbsp; &lt;br /&gt;前根序遍历类似。&lt;br /&gt;以上的方法只适用于三层以内的二叉树（含三层）。在选择题中，三层以上二叉树也可用以上方法初步判断正确答案。&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/diylab/aggbug/473874.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/diylab/archive/2011/05/10/473874.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry></feed>
