Revision 143
Added by Aaron Marcuse-Kubitza about 13 years ago
xpath.py | ||
---|---|---|
171 | 171 |
parent.setAttribute(elem.name, '') |
172 | 172 |
node = parent.getAttributeNode(elem.name) |
173 | 173 |
else: node = parent.appendChild(doc.createElement(elem.name)) |
174 |
if elem.value != None: xml_dom.set_value(doc, node, elem.value)
|
|
174 |
if elem.value != None: xml_dom.set_value(node, elem.value) |
|
175 | 175 |
if create: |
176 | 176 |
for attr in elem.keys + elem.attrs: |
177 | 177 |
get(node, attr, create, last_only) |
... | ... | |
203 | 203 |
|
204 | 204 |
# Will append if target keys didn't match. Place ! in XPath |
205 | 205 |
# after element to fork at to avoid this. |
206 |
xml_dom.set_value(doc, node, id_)
|
|
206 |
xml_dom.set_value(node, id_) |
|
207 | 207 |
else: last_only = False |
208 | 208 |
set_id(xpath, id_) |
209 | 209 |
return get(root, xpath, create, last_only) |
Also available in: Unified diff
Refactored xml_dom.set_value() to avoid needing a doc parameter for the XML document