Skip to content

Commit 36c90ee

Browse files
1 parent f08d95c commit 36c90ee

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ch5/ch5-05.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ <h2>5.5. 函数值</h2>
623623
...
624624
</code></pre>
625625
<p><strong>练习 5.7:</strong> 完善startElement和endElement函数,使其成为通用的HTML输出器。要求:输出注释结点,文本结点以及每个元素的属性(&lt; a href='...'&gt;)。使用简略格式输出没有孩子结点的元素(即用<code>&lt;img/&gt;</code>代替<code>&lt;img&gt;&lt;/img&gt;</code>)。编写测试,验证程序输出的格式正确。(详见11章)</p>
626-
<p><strong>练习 5.8:</strong> 修改pre和post函数,使其返回布尔类型的返回值。返回false时,中止forEachNoded的遍历。使用修改后的代码编写ElementByID函数,根据用户输入的id查找第一个拥有该id元素的HTML元素,查找成功后,停止遍历。</p>
626+
<p><strong>练习 5.8:</strong> 修改pre和post函数,使其返回布尔类型的返回值。返回false时,中止forEachNode的遍历。使用修改后的代码编写ElementByID函数,根据用户输入的id查找第一个拥有该id元素的HTML元素,查找成功后,停止遍历。</p>
627627
<pre><code class="language-Go">func ElementByID(doc *html.Node, id string) *html.Node
628628
</code></pre>
629629
<p><strong>练习 5.9:</strong> 编写函数expand,将s中的&quot;foo&quot;替换为f(&quot;foo&quot;)的返回值。</p>

0 commit comments

Comments
 (0)