약 1GB의 매우 큰 트리와 같은 XML 파일이 있습니다.
value가 포함되지 않은 <Sample> ... </Sample>
하위 행을 포함하는 행을 삭제해야 <Sample> ... </Sample>
합니다 <segmentation><![CDATA[0.11]]></segmentation>
.
예를 들어 다음과 같이 태그가있는 행이 있습니다.
<segmentation><![CDATA[0.11]]></segmentation>
<segmentation><![CDATA[0.25]]></segmentation>
<segmentation><![CDATA[0.61]]></segmentation>
아래 예 에서 태그에 하위 <Sample>
행만 <Sample>
포함하여 모든 행과 하위 행 을 삭제할 수 <segmentation><![CDATA[0.11]]></segmentation>
있습니까?
머리 글자:
<Sample>
<title><![CDATA[South Park]]></title>
<date><![CDATA[Tue, 29 Nov 2016 00:00:00 EST]]></date>
<referencenumber><![CDATA[20983990]]></referencenumber>
<segmentation><![CDATA[0.11]]></segmentation>
<description><![CDATA[Some text goes here]]></description>
</Sample>
<Sample>
<title><![CDATA[South Park]]></title>
<date><![CDATA[Tue, 29 Nov 2016 00:00:00 EST]]></date>
<referencenumber><![CDATA[20983990]]></referencenumber>
<segmentation><![CDATA[0.25]]></segmentation>
<description><![CDATA[Some text goes here]]></description>
</Sample>
<Sample>
<title><![CDATA[South Park]]></title>
<date><![CDATA[Tue, 29 Nov 2016 00:00:00 EST]]></date>
<referencenumber><![CDATA[20983990]]></referencenumber>
<segmentation><![CDATA[0.61]]></segmentation>
<description><![CDATA[Some text goes here]]></description>
</Sample>
결과:
<Sample>
<title><![CDATA[South Park]]></title>
<date><![CDATA[Tue, 29 Nov 2016 00:00:00 EST]]></date>
<referencenumber><![CDATA[20983990]]></referencenumber>
<segmentation><![CDATA[0.11]]></segmentation>
<description><![CDATA[Some text goes here]]></description>
</Sample>