我使用Perl和XML::Simple模塊創建XML文件。我成功創建了XML文件,但問題是我爲每個標籤都有<opt> </opt>
標籤。我正在尋找任何我們可以避開<opt> </opt>
標籤的選項。我無法進行後期處理來移除標籤。因爲文件大小很大。如何刪除XML :: Simple輸出中的<opt>標籤?
實施例:
<opt>
<person firstname="Joe" lastname="Smith">
<email>[email protected]</email>
<email>[email protected]</email>
</person>
<person firstname="Bob" lastname="Smith">
<email>[email protected]</email>
</person>
</opt>
和我尋找(無<opt>
標籤):
<person firstname="Joe" lastname="Smith">
<email>[email protected]</email>
<email>[email protected]</email>
</person>
<person firstname="Bob" lastname="Smith">
<email>[email protected]</email>
</person>
如果選擇是你的根節點,其結果是無效的XML,它必須有一個根節點。 – Axeman 2009-07-01 15:08:12