modifying xml file using LibXML -


i'm trying modify file has xml syntax

<!doctype xml> <lrf instance_prefix="u" pdescription="type:%20ddr2%20sdram;&#xa;density:%204gb;&#xa;data:%20x16;&#xa;banks:%208;&#xa;configuration:%2016m%20x%2016%20x%208;&#xa;voltage:%201.8v;&#xa;standard:%20jedec;&#xa;pins:%2084;&#xa;package:%20fbga;&#xa;package%20standard:%20mo-207;%20package%20variation:%20dk-z;&#xa;die:%20single%20die(sd)%20package;&#xa;target%20device%20family:%20virtex-7;" unit="mm" target_family="v7" jedec_type="ddr2_sdram_mo207_dk_z" y_offset="0" interface_type="normalinterface" x_offset="0" model_constraint="same_vccaux" pin_size="0.45">  <group group_number="1" group_name="address_control" group_constraint="memory_address" group_color="#9accff">   <pin pin_number="m8" pin_type="input" pin_standard="sstl18_ii" pin_x_loc="5.6" signal_name="a&lt;0>" pin_y_loc="2.4" symbol_pin_name="ddr2_sdram_a&lt;0>"/>   <pin pin_number="m3" pin_type="input" pin_standard="sstl18_ii" pin_x_loc="1.6" signal_name="a&lt;1>" pin_y_loc="2.4" symbol_pin_name="ddr2_sdram_a&lt;1>"/>   .   .   .  </group>  <group group_number="4" group_name="power" group_color="#ff0000">   <pin pin_number="a1" pin_type="supply" pin_voltage="1.8" pin_x_loc="0" signal_name="vdd" pin_y_loc="11.2" symbol_pin_name="vdd"/>   <pin pin_number="e1" pin_type="supply" pin_voltage="1.8" pin_x_loc="0" signal_name="vdd" pin_y_loc="8" symbol_pin_name="vdd"/>   <pin pin_number="j9" pin_type="supply" pin_voltage="1.8" pin_x_loc="6.4" signal_name="vdd" pin_y_loc="4.8" symbol_pin_name="vdd"/>   .   .   .  </group> . . </lrf>  

my task signal_name value "vdd" , if present, remove entire <pin .... /> node. if there no elements available in group node after above task, remove <group....> </group> node.

i've tried task using xml::simple, order keeps changing elements. so, i'm trying complete task using xml::libxml. can 1 throw light on how complete task using libxml. appreciated. thanks


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -