Revision 1011
Added by Aaron Marcuse-Kubitza almost 13 years ago
xpath.py | ||
---|---|---|
215 | 215 |
is_match = value_ == None or xml_dom.value(child) == value_ |
216 | 216 |
for attr in elem.keys: |
217 | 217 |
if not is_match: break |
218 |
is_match = ((get(child, attr, False, last_only) != [])
|
|
219 |
== is_positive(attr)) |
|
218 |
is_match = ((get(child, attr, False, last_only,
|
|
219 |
allow_rooted=False) != []) == is_positive(attr))
|
|
220 | 220 |
if is_match: |
221 | 221 |
nodes.append(child) |
222 | 222 |
if limit != None and len(nodes) >= limit: break |
... | ... | |
239 | 239 |
# Create attrs |
240 | 240 |
if create: |
241 | 241 |
for attr in elem.keys + elem.attrs: |
242 |
get(node, attr, create, last_only) |
|
242 |
get(node, attr, create, last_only, allow_rooted=False)
|
|
243 | 243 |
|
244 | 244 |
# Follow pointer |
245 | 245 |
if elem.is_ptr: |
Also available in: Unified diff
xpath.py: Don't allow rooted attributes (doesn't make sense), in case someone tries to do elem[/rooted_attr]