On Nov 10, 12:47*pm, "Álvaro G. Vicario"
<alvaroNOSPAMTH A...@demogracia .comwrote:
alexus escribió:
i have test.xml file that i pull from someone, and when i try to load
it up into php
I get this
mbp:cj alexus$ php api.php
SimpleXMLElemen t Object
(
)
mbp:cj alexus$
this is my code
<?php
$xml=simplexml_ load_file ('test.xml');
print_r($xml);
?>
I my (short) experience with SimpleXML I've noticed that print_r() and
var_dump() don't always display the objects accurately. Try accessing
some piece of data. If you don't get any warning when calling
simplexml_load_ file() I don't think there loading itself failed.
Also, feel free to post here a short version of your XML file so we can
have a look.
--
--http://alvaro.es- Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:http://bits.demogracia.com
-- Mi web de humor al baño María:http://www.demogracia.com
--
<soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema" xmlns:xsi="http ://
www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<searchRespon se xmlns="http://api.cj.com">
<out xmlns="http://api.cj.com">
<advertisers xmlns="http://advertiser.serv ice.cj.com">
<ns1:Advertiser Data xmlns:ns1="http ://vo.domain.cj.co m">
<cid xmlns="http://vo.domain.cj.co m">1656602</cid>
<clickCommissio n xmlns="http://vo.domain.cj.co m">0.0</
clickCommission >
<leadCommissi on xmlns="http://vo.domain.cj.co m"></
leadCommission>
<linkTypes xmlns="http://vo.domain.cj.co m">
<ns2:string xmlns:ns2="http ://api.cj.com">Ban ner</ns2:string>
<ns2:string xmlns:ns2="http ://api.cj.com">Tex t Link</
ns2:string>
<ns2:string xmlns:ns2="http ://api.cj.com">Key word Link</
ns2:string>
</linkTypes>
<name xmlns="http://vo.domain.cj.co m">Sony Style Canada</name>
<networkRank xmlns="http://vo.domain.cj.co m">3</networkRank>
<performanceInc entives xmlns="http://vo.domain.cj.co m">true
</performanceInce ntives>
<primaryCategor yId xmlns="http://vo.domain.cj.co m">397
</primaryCategory Id>
<primaryCategor yName xmlns="http://vo.domain.cj.co m">
<ns2:string xmlns:ns2="http ://api.cj.com">Con sumer Electronics
</ns2:string>
</primaryCategory Name>
<relationshipSt atus xmlns="http://vo.domain.cj.co m">joined
</relationshipSta tus>
<saleCommissi on xmlns="http://
vo.domain.cj.co m">3.5000000000 000004%</saleCommission> <sevenDayEPC
xmlns="http://vo.domain.cj.co m">10.551</sevenDayEPC><th reeMonthEPC
xmlns="http://vo.domain.cj.co m">9.325</threeMonthEPC></
ns1:AdvertiserD ata></advertisers><cu rrentPage xmlns="http://
advertiser.serv ice.cj.com">0</currentPage><re sultsPerpage
xmlns="http://advertiser.serv ice.cj.com">1</
resultsPerpage> <totalResults xmlns="http://
advertiser.serv ice.cj.com">48</totalResults></out></searchResponse> </
soap:Body></soap:Envelope>