0
I want to read the XML and get the tag data <product zupid="fe36ddb561f0cd98f693722931fa2b83">
but I’m not getting it.
Part of XML:
<?xml version="1.0" encoding="UTF-8"?>
-<products xsi:schemaLocation="http://zanox.com/productdata/exportservice/v1 http://productdata.zanox.com/exportservice/schema/export_new_retail.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-<product zupid="fe36ddb561f0cd98f693722931fa2b83">
<name>Raquete Winmax Thrones 300</name>
<number>X68-0092-010</number>
<deepLink>http://ad.zanox.com/ppc/?45860320C867715000&ULP=[[pdp/X68-0092-010?campaign=me_xml-afiliados&utm_source=me-s_zanx_&utm_medium=xml&utm_campaign=me-s_zanx-xml-_-jogos_me-s_zanx-xmlwinmax-_-raquete-winmax-thrones-300-_-::N3T:AF-AW-00-00-00-TD:N3T::_{{::N3T:AF-AW-00-00-00-TD:N3T::}}&utm_term=]]</deepLink>
<price>99.99</price>
<oldPrice>190.46</oldPrice>
<currencyCode>BRL</currencyCode>
<description>Raquete Badminton Thrones vermelha. Produzida em carbono grafite, cabeça 100% de alumínio + eixo de aço, é resistente e de alta qualidade. Alcança a flexibilidade de : 7.5 - 8.0 e 26-28lbs. Cabo ...</description>
<longDescription>Raquete Badminton Thrones vermelha. Produzida em carbono grafite, cabeça 100% de alumínio + eixo de aço, é resistente e de alta qualidade. Alcança a flexibilidade de : 7.5 - 8.0 e 26-28lbs. Cabo ...</longDescription>
<merchantCategoryPath>Jogos</merchantCategoryPath>
<largeImage>https://static.netshoes.com.br/produtos/raquete-winmax-thrones-300/10/X68-0092-010/X68-0092-010_detalhe1.jpg</largeImage>
<lastModified>2019-07-02T09:11:00</lastModified>
<stockAmount>null</stockAmount>
<program>12078</program>
<ean>6947663402090</ean>
<manufacturer>Winmax</manufacturer>
<gender>Unissex</gender>
</product>
...
I’m using:
$url = "...";
$feed = simplexml_load_file($url);
foreach($feed->children() as $item){
$IdProduto = trim($item->product('zupid');
echo "$IdProduto<br>";
}
Hello Bruno. And how would you look to read all the product id of an XML file, which is a lot of records, as would be the foreach with PHP? Thank you for your reply.
– Carlos Silva