Lines Matching +full:child +full:- +full:node
27 This will add a new enumerationType element child to the root element.
54 4) Add child elements to a specific element. Useful when adding several
55 child elements at once.
57 Use a type attribute of 'add-child' and specify the target parent with
60 <enumerationType type="add-child" xpath="enumerationType/[id='TYPE']">
74 5) Replace a child element inside another element, useful when replacing
75 several child elements of the same parent at once.
77 Use a type attribute of 'replace-child' and the xpath attribute
81 <enumerationType type="replace-child"
117 parser.add_argument("-x", dest="xml", help="The input XML file")
118 parser.add_argument("-p", dest="patch_xml", help="The patch XML file")
119 parser.add_argument("-o", dest="output_xml", help="The output XML file")
124 sys.exit(-1)
133 for node in patch_root:
135 (node.tag is etree.PI)
136 or (node.tag is etree.Comment)
137 or (node.tag == "targetFile")
143 xpath = node.get("xpath", None)
144 patch_type = node.get("type", "add")
145 patch_key = node.get("key", None)
146 delete_attrs(node, ["xpath", "type", "key"])
163 # elements at the root node, so make sure they get appended
166 root.append(node)
168 target.append(node)
191 parent.append(node)
193 elif patch_type == "add-child":
194 for child in node:
197 + child.tag
198 + "' child element to "
201 target.append(child)
203 elif patch_type == "replace-child":
206 " E> Patch type is replace-child, but"
210 for child in node:
212 key_element = child.find(patch_key)
220 update["add"] = child
246 sys.exit(-1)