modifying xml file using LibXML -
i'm trying modify file has xml syntax
<!doctype xml> <lrf instance_prefix="u" pdescription="type:%20ddr2%20sdram;
density:%204gb;
data:%20x16;
banks:%208;
configuration:%2016m%20x%2016%20x%208;
voltage:%201.8v;
standard:%20jedec;
pins:%2084;
package:%20fbga;
package%20standard:%20mo-207;%20package%20variation:%20dk-z;
die:%20single%20die(sd)%20package;
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<0>" pin_y_loc="2.4" symbol_pin_name="ddr2_sdram_a<0>"/> <pin pin_number="m3" pin_type="input" pin_standard="sstl18_ii" pin_x_loc="1.6" signal_name="a<1>" pin_y_loc="2.4" symbol_pin_name="ddr2_sdram_a<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
Post a Comment