Revision 156
Added by Aaron Marcuse-Kubitza about 13 years ago
scripts/lib/xpath.py | ||
---|---|---|
7 | 7 |
|
8 | 8 |
class XpathElem: |
9 | 9 |
def __init__(self, name, value=None, is_attr=False): |
10 |
if name == '': name = '.' |
|
10 | 11 |
self.name = name |
11 | 12 |
self.value = value |
12 | 13 |
self.is_attr = is_attr |
... | ... | |
62 | 63 |
break # nothing allowed after split path |
63 | 64 |
|
64 | 65 |
elem = XpathElem(is_attr=parser.str_('@'), |
65 |
name=parser.re(r'[\w.*]+', required=True))
|
|
66 |
name=parser.re(r'[\w.*]*', required=True))
|
|
66 | 67 |
|
67 | 68 |
# Keys used to match nodes |
68 | 69 |
if parser.str_('['): |
Also available in: Unified diff
xpath.py: Allowed empty names in XPaths