现有一个XML文件,是截取的用户POST的一封163邮件,内容如下:
<?xml version="1.0"?><object><string name="action">deliver</string><string name="id">vBeXiLVVkVBnaSCcOmVVEwHQESYUEKHV</string><object name="attrs"><string name="account">"programtest" <[email protected]></string><array name="to"><string>"programtest" <[email protected]></string></array><array name="cc"/><array name="bcc"/><string name="subject">Fw:!@#!$#@^$&%*%%:<">?>"<:"L">?>>(*&(*&(</string><string name="content"><DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>---------- 转发邮件信息 ----------<BR>发件人:"programtest &lt;[email protected]&gt;" <BR>发送日期:2009-06-03 18:11:08<BR>收件人:programtest &lt;[email protected]&gt;<BR>主题: !@#!$#@^$&amp;%*%%:&lt;"&gt;?&gt;"&lt;:"L"&gt;?&gt;&gt;(*&amp;(*&amp;(<BR>
<DIV>搜狐<A href="http://auto.sohu.com/" target=_blank><FONT color=#000099>汽车</FONT></A>讯 据美国有线电视新闻网(CNN)6月2日报道,<A href="http://jsp.auto.sohu.com/view/group-gid-240.html" target=_blank><FONT color=#000099>通用汽车</FONT></A>公司(General Motors Corp)就出售旗下<A href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>(<A href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>Hummer</FONT></A>)品牌已经与买方达成协议。<A class=teshu href="http://jsp.auto.sohu.com/view/group-gid-240.html" target=_blank><FONT color=#000099>通用汽车</FONT></A>公司证实<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>买家为一家中国企业——总部位于成都的四川腾中重工机械有限公司(Sichuan Tengzhong Heavy Industrial Machinery Company Ltd.)。 
<P>  1999年,<A class=teshu href="http://jsp.auto.sohu.com/view/group-gid-240.html" target=_blank><FONT color=#000099>通用汽车</FONT></A>收购了<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>品牌的所有权。作为一家民营企业,腾中重工机械有限公司表示,计划保留<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>的管理团队。腾中重工总经理杨毅表示,“在当前管<BR>&gt;<BR>:L<BR>&gt;<BR>&gt;":&gt;"L:<BR>:<BR>"?&gt;"&gt;?&lt;"&lt;"L":&gt;":&gt;&gt;":&lt;":L":"&lt;_)(*_(<A href="mailto:*&amp;*%&amp;^$#%@!#$@%E&amp;*T*((Y">*&amp;*%&amp;^$#%@!#$@%E&amp;*T*((Y</A>()*)(*_)&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;理团队的领导下,<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>品牌将以全新的方式不断创新和增长。我们计划对<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>品牌和产品研发能力投入资源,从而满足美国和全球市场对如高燃油效率的新产品的需求。”腾中重工表示,此交易将于今年九月底完成交割。</P></DIV><BR><BR><SPAN title=neteasefooter>
<HR>
<A href="http://qiye.163.com/?ft=3">网易企业邮,商务邮箱专家</A> </SPAN></string><boolean name="isHtml">true</boolean><int name="priority">3</int><boolean name="saveSentCopy">true</boolean><boolean name="requestReadReceipt">false</boolean><string name="charset">gbk</string><string name="id">vBeXiLVVkVBnaSCcOmVVEwHQESYUEKHV</string></object><int name="saveSentLimit">1</int></object>
如何用php,来处理该XML文件?

解决方案 »

  1.   

    使用HTML转换为XHTML的开源工具HTML Tidy
      

  2.   

    本身就不是标准的xml,所以转换肯定是不太现实的.
    直接当做html来解析吧.
    用tidy_function
      

  3.   

    不是xml的,就当html 解析xml是严格按标准的,否则不叫xml
      

  4.   

    先弄成標準的XML或者自由火說的HTML,沒有標準不成方圓
      

  5.   

    首先谢谢大家,因为我要解析里面的数据然后处理,大家的方法都试过了,不好使。我把他当成字符串处理了。
    分就平分给大家喽。thanks。