mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
numbering issue
This commit is contained in:
@@ -92,7 +92,7 @@ pre a,.w a{padding:0.4375em 0}
|
||||
.w a{text-decoration:underline}
|
||||
kbd,mark{font-weight:bold}
|
||||
mark{display:inline-block;width:100%;background:#ff8}
|
||||
.p{color:#667}
|
||||
pre span,.p{color:#667}
|
||||
|
||||
/* overrides */
|
||||
li ol,.q{margin:0}
|
||||
|
||||
@@ -337,8 +337,7 @@ mark{display:inline}
|
||||
<samp>[]</samp></pre>
|
||||
<ol>
|
||||
<li>The <code>findall()</code> method finds child elements that match a specific query. (More on the query format in a minute.)
|
||||
<li>Each element — including the root element, but also child elements — has a <code>findall()</code> method. It finds all matching elements among the element’s children.
|
||||
<li>What happened here? Although it may not be obvious, this particular <code>findall()</code> query only searches the element’s children. Since the root <code>feed</code> element has no child named <code>feed</code>, this query returns an empty list.
|
||||
<li>Each element — including the root element, but also child elements — has a <code>findall()</code> method. It finds all matching elements among the element’s children. But why aren’t there any results? Although it may not be obvious, this particular query only searches the element’s children. Since the root <code>feed</code> element has no child named <code>feed</code>, this query returns an empty list.
|
||||
<li>This result may also surprise you. <a href=#divingin>There is an <code>author</code> element</a> in this document; in fact, there are three (one in each <code>entry</code>). But those <code>author</code> elements are not <em>direct children</em> of the root element; they are “grandchildren” (literally, a child element of a child element). If you want to look for <code>author</code> elements at any nesting level, you can do that, but the query format is slightly different.
|
||||
</ol>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user