Revision 135
Added by Aaron Marcuse-Kubitza about 13 years ago
xpath.py | ||
---|---|---|
142 | 142 |
if last_only == None: last_only = create |
143 | 143 |
|
144 | 144 |
if create and not is_positive(xpath): return None |
145 |
doc = parent.ownerDocument |
|
145 | 146 |
for elem_idx, elem in enumerate(xpath): |
146 | 147 |
# Find possible matches |
147 | 148 |
children = [] |
... | ... | |
216 | 217 |
if value != None: set_value(xpath, value) |
217 | 218 |
get(doc, xpath, True) |
218 | 219 |
|
219 |
def path2xml(xpath): |
|
220 |
doc = xml_dom.create_doc() |
|
221 |
get(doc, xpath, True) |
|
222 |
return doc.documentElement |
|
220 |
def path2xml(xpath, first_branch=True): |
|
221 |
root = xml_dom.create_doc().documentElement |
|
222 |
get(root.ownerDocument, xpath, True) |
|
223 |
if first_branch: root = root.firstChild |
|
224 |
return root |
|
223 | 225 |
|
224 | 226 |
def str2xml(xpath): return path2xml(parse(xpath)) |
Also available in: Unified diff
map: Implemented DB input support for querying a single table