javascript - How to remove Data between Tags -
javascript - How to remove Data between Tags -
i have big amount of data, , have task create mapping of same. create mapping want delete info between till in xml. below illustration want have.
<subissue id = "1" sname = "heading"> <issues> <child name="symptom/ cause" value="how to"></child> </issues> <questions> <question> <![cdata[<font color='#333333' size='3' face='calibri'><b>bull</b></font> <font color='#15428b' size='2' face='calibri'>1data1</font> <font color='#333333' size='3' face='calibri'><b>rock</b></font> <font color='#15428b' size='2' face='calibri'>data2</font> </br>]]> </question> </questions> <sp>no</sp> </subissue>
so want delete info betwen <subissue>
, </subissue>
. should this
<subissue> </subissue>
that's it.
i can utilize language php, html or anything./ visual basic do. please help
and in php ...
$dom = new domdocument(); $data = $dom->loadxml($yourxmlstring); $tmp = $dom->documentelement; $childnodes = $tmp->getelementsbytagname('subissue')->item(0)->childnodes; foreach ($childnodes $node) { $node->parentnode->removechild(clone $node); } echo $dom->savexml();
this code not tested.
javascript php html vba
Comments
Post a Comment