<webmethod id="service_disorder_to_cp">
<cpcode value="91402"/>
<userid value="5D2522"/>
<encryptflag value="Y"/>
<serviceid value="5029140204"/>
<ispack value="N"/>
<sub_type value="PER_HIT"/>
<disorderdate value="2008-3-18 15:42:59"/>
<operatingtime value="2008-3-18 15:43:00"/>
<feeflag value="Y"/>
<platid value="904"/>
<fromflag value="01"/>
<stateflag value="1"/>
<planid value="600000000008933"/></webmethod>
求教大家了

解决方案 »

  1.   

    给你个参考下,写的不好,别见笑
         <?php
    $firstimagelist=$doc->getElementsByTagName('firstimage');
    $itemnode=$firstimagelist->item(0)->firstChild->firstChild;

    $firstimagetitle=$itemnode->nodeValue;
    $firstimageurl=$itemnode->nextSibling->nodeValue;
    $firstimage=$firstimagelist->item(0)->firstChild->lastChild->previousSibling->getAttribute('file');

         echo '<a class="tuijian_img" href="'.$firstimageurl.'" target="_blank"><img src="'.$firstimage.'" alt="" width="70" height="65" /><span>'.converString($firstimagetitle,1).'</span></a>';
    ?>
      

  2.   

    去网上找一个现成的php的xml解析类,比如  SofeeXmlParser
      

  3.   

    <?php
    $xml = <<< XML
    <webmethod id="service_disorder_to_cp"> 
    <cpcode value="91402"/> 
    <userid value="5D2522"/> 
    <encryptflag value="Y"/> 
    <serviceid value="5029140204"/> 
    <ispack value="N"/> 
    <sub_type value="PER_HIT"/> 
    <disorderdate value="2008-3-18 15:42:59"/> 
    <operatingtime value="2008-3-18 15:43:00"/> 
    <feeflag value="Y"/> 
    <platid value="904"/> 
    <fromflag value="01"/> 
    <stateflag value="1"/> 
    <planid value="600000000008933"/> </webmethod> 
    XML;
    $x = simplexml_load_string($xml);
    print_r($x);
    ?>
    SimpleXMLElement Object
    (
        [@attributes] => Array
            (
                [id] => service_disorder_to_cp
            )    [cpcode] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => 91402
                    )        )    [userid] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => 5D2522
                    )        )    [encryptflag] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => Y
                    )        )    [serviceid] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => 5029140204
                    )        )    [ispack] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => N
                    )        )    [sub_type] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => PER_HIT
                    )        )    [disorderdate] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => 2008-3-18 15:42:59
                    )        )    [operatingtime] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => 2008-3-18 15:43:00
                    )        )    [feeflag] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => Y
                    )        )    [platid] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => 904
                    )        )    [fromflag] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => 01
                    )        )    [stateflag] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => 1
                    )        )    [planid] => SimpleXMLElement Object
            (
                [@attributes] => Array
                    (
                        [value] => 600000000008933
                    )        ))
      

  4.   

    打听一下,这个xml规范,适合联通的那一类业务,cwap1.2?cwap2.0?还是?