我有以下格式的文本:
<cast_member billing="top">
<display_name>Elijah Wood</display_name>
<character_name>#9 (voice)</character_name>
<locales>
<locale name="ko-KR">
<display_name>일라이자 우드</display_name>
</locale>
<locale name="cmn-Hant">
<display_name>伊利亞伍德</display_name>
</locale>
</locales>
</cast_member>
<cast_member billing="top">
<display_name>Peter Pan</display_name>
<character_name>#8 (voice)</character_name>
</cast_member>
当标签存在时,我将如何删除<locales>
标签内和包含的所有内容。上面的输入将如下所示:
<cast_member billing="top">
<display_name>Elijah Wood</display_name>
<character_name>#9 (voice)</character_name>
</cast_member>
<cast_member billing="top">
<display_name>Peter Pan</display_name>
<character_name>#8 (voice)</character_name>
</cast_member>