我需要從其他程序生成的文件刪除非XML標籤。一個簡單的方法來從XML文件刪除頁眉
該文件是一些這樣的:
Executing Command - Blah.exe ...
-----Command Output-----
HTTP/1.1 200 OK
Connection: close
Content-Type: text/xml
<?xml version="1.0"?>
<testResults>
<finalCounts>
<right>7</right>
<wrong>4</wrong>
<ignores>0</ignores>
<exceptions>0</exceptions>
</finalCounts>
</testResults>
Exit-Code: 15
如何輕鬆去除Java中的非XML文本?
您可能需要從'xmlIndex'添加或1。減去。 – 2010-04-20 21:19:25
是PHP找這個,但是這有助於弄清楚依然。好工作。 – IamFace 2013-07-12 22:40:19