On Nov 10, 12:47*pm, "Álvaro G. Vicario"
<alvaroNOSPAMTHA...@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
SimpleXMLElement 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:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<searchResponse xmlns="http://api.cj.com">
<out xmlns="http://api.cj.com">
<advertisers xmlns="http://advertiser.service.cj.com">
<ns1:AdvertiserData xmlns:ns1="http://vo.domain.cj.com">
<cid xmlns="http://vo.domain.cj.com">1656602</cid>
<clickCommission xmlns="http://vo.domain.cj.com">0.0</
clickCommission>
<leadCommission xmlns="http://vo.domain.cj.com"></
leadCommission>
<linkTypes xmlns="http://vo.domain.cj.com">
<ns2:string xmlns:ns2="http://api.cj.com">Banner</ns2:string>
<ns2:string xmlns:ns2="http://api.cj.com">Text Link</
ns2:string>
<ns2:string xmlns:ns2="http://api.cj.com">Keyword Link</
ns2:string>
</linkTypes>
<name xmlns="http://vo.domain.cj.com">Sony Style Canada</name>
<networkRank xmlns="http://vo.domain.cj.com">3</networkRank>
<performanceIncentives xmlns="http://vo.domain.cj.com">true
</performanceIncentives>
<primaryCategoryId xmlns="http://vo.domain.cj.com">397
</primaryCategoryId>
<primaryCategoryName xmlns="http://vo.domain.cj.com">
<ns2:string xmlns:ns2="http://api.cj.com">Consumer Electronics
</ns2:string>
</primaryCategoryName>
<relationshipStatus xmlns="http://vo.domain.cj.com">joined
</relationshipStatus>
<saleCommission xmlns="http://
vo.domain.cj.com">3.5000000000000004%</saleCommission><sevenDayEPC
xmlns="http://vo.domain.cj.com">10.551</sevenDayEPC><threeMonthEPC
xmlns="http://vo.domain.cj.com">9.325</threeMonthEPC></
ns1:AdvertiserData></advertisers><currentPage xmlns="http://
advertiser.service.cj.com">0</currentPage><resultsPerpage
xmlns="http://advertiser.service.cj.com">1</
resultsPerpage><totalResults xmlns="http://
advertiser.service.cj.com">48</totalResults></out></searchResponse></
soap:Body></soap:Envelope>