日期:2014-05-17  浏览次数:20504 次

请教大家一个解析XML的问题,谢谢
XML code
 <alipay>
  <is_success>T</is_success>
  <request>
    <param   name="partner">2088002007***</param>
    <param   name="logistics_name">天天</param>
    <param   name="create_transport_type">EMS</param>
    <param   name="trade_no">2008040902***</param>
    <param   name="agent">20880020070***</param>
    <param   name="notify_url">
      http://10.2.5.100/api/apireceive/returnSuccess.php</param>
      <param   name="invoice_no">3455**</param>
      <param       name="service">send_goods_confirm_by_platform</param>
      <param       name="_input_charset">utf-8</param>
      <param       name="transport_type">EMS</param>
      <param   name="return_url">http://10.2.5.100/api/returnResultList.php</param>
    </request>
  <response>
    <tradeBase>
      <buyer_account>2088002007301423***</buyer_account>
      <buyer_actions>[REFUND,CONFIRM_GOODS]</buyer_actions>
      <buyer_login_email>***</buyer_login_email>
      <buyer_type>PRIVATE_ACCOUNT</buyer_type>
      <buyer_user_id>2088002007****</buyer_user_id>
      <channel>interface/digi***</channel>
      <create_time>2008-04-09       16:10:25</create_time>
      <currency>156</currency>
      <gathering_type>1</gathering_type>
      <last_modified_time>2008-04-10 14:35:25</last_modified_time>
      <operator_role>B</operator_role>
      <out_trade_no>123455666***</out_trade_no>
      <partner_id>2088002007***6</partner_id>
      <seller_account>208800200730***156</seller_account>
      <seller_actions>[EXTEND_TIMEOUT]</seller_actions>
      <seller_login_email>song_xia**hoo.com.cn</seller_login_email>
      <seller_type>PRIVATE**OUNT</seller_type>
      <seller_user_id>208800**301410</seller_user_id>
      <service_fee>0.00</service_fee>
      <service_fee_ratio>0.0</service_fee_ratio>
      <stop_timeout>F</stop_timeout>
      <total_fee>2.00</total_fee>
      <trade_from>INST_P**ER</trade_from>
      <trade_no>2008040**81748</trade_no>
      <trade_status>WAIT_BUYER_CONFIRM_GOODS</trade_status>
      <trade_type>S</trade_type>
    </tradeBase>
  </response>
  <sign>eb07c7407baf*****0804751a21c1e</sign>
  <sign_type>MD5</sign_type>
</alipay>




我想获取alipay下的is_success节点的值 。 
我是的代码是这样写的
$message=$doc->getElementsByTagName("alipay")->item(0)->nodeValue;
但是好像获取的值不对。 请教下大家如何获取这个值了。 谢谢

------解决方案--------------------
$message=$doc->getElementsByTagName("is_success")->item(0)->nodeValue;