I'm looking to parse out only the content of the element below into its own XML document, but am unsure of the proper PHP method to use. XML data in boxb.php is unable to be modified.
EX:
Parsing code:
<?php
include 'boxb.php';
$boxb = new SimpleXMLElement($xmlstr);
$boxb->ad[0]->content;
echo $boxb->ad[0]->content;
?>
boxb.php contains the following:
<?php
$xmlstr = <<<XML
<boxb>
<ad type="agnostic_template">
<url><![CDATA[http://ads.cookie.com/8/redir/1db04901-225e-11e4-86f3-bc305bf4914b/0/632361]]></url>
<track />
<content>
<VAST version="2.0">
<Ad id="228">
<InLine>
<AdSystem version="4.11.0-10">LiveRail</AdSystem>
<AdTitle><![CDATA[TV Overlay PNG]]></AdTitle>
<Description />
<Error><![CDATA[http://t4.liverail.com/?metric=error&erc=[ERRORCODE]&pos=1&coid=135&pid=1331&nid=1331&oid=228&olid=2281331&cid=8455&tpcid=&vid=&amid=&cc=default&pp=&vi=0&vv=&sg=&tsg=&pmu=0&pau=0&psz=0&ctx=&tctx=&coty=7&adt=0&did=&buid=&scen=&mca=&mma=&mct=0&url=http%3A%2F%2Fwww.iab.net%2Fguidelines%2F508676%2Fdigitalvideo%2Fvast%2Fvast_xml_samples&trid=53ea9957dc20a5.06241648&bidf=0.00000&bids=0.00000&bidt=1&bidh=0&bidlaf=0&cb=6662.66.104.228.162.0&ver=1&w=&wy=&x=&y=&xy=&redirect=]]></Error>
<Impression id="LR"><![CDATA[http://t4.liverail.com/?metric=impression&cofl=0&flid=0&pos=1&coid=135&pid=1331&nid=1331&oid=228&olid=2281331&cid=8455&tpcid=&vid=&amid=&cc=default&pp=&vi=0&vv=&sg=&tsg=&pmu=0&pau=0&psz=0&ctx=&tctx=&coty=7&adt=0&did=&buid=&scen=&mca=&mma=&mct=0&url=http%3A%2F%2Fwww.iab.net%2Fguidelines%2F508676%2Fdigitalvideo%2Fvast%2Fvast_xml_samples&trid=53ea9957dc20a5.06241648&bidf=0.00000&bids=0.00000&bidt=1&bidh=0&bidlaf=0&cb=6662.66.104.228.162.0&ver=1&w=&wy=&x=29&y=29&xy=9dae&z2=0.00000]]></Impression>
<Impression id="QC"><![CDATA[http://pixel.quantserve.com/pixel/p-d05JkuPGiy-jY.gif?r=6662]]></Impression>
<Impression id="CS"><![CDATA[http://b.scorecardresearch.com/p?c1=1&c2=9864668&c3=1331&c4=&c5=09]]></Impression>
<Impression><![CDATA[http://load.exelator.com/load/?p=104&g=440&j=0]]></Impression>
<Impression><![CDATA[http://navdmp.com/usr?vast=http%3A%2F%2Ft4.liverail.com%2F%3Fmetric%3Dmsync%26p%3D78]]></Impression>
<Impression><![CDATA[http://pixel.tapad.com/idsync/ex/receive?partner_id=LIVERAIL&partner_device_id=97838239447]]></Impression>
<Impression><![CDATA[http://t4.liverail.com/?metric=rsync&p=3016&redirect=http%3A%2F%2Fliverail2waycm-atl.netmng.com%2Fcm%2F%3Fredirect%3Dhttp%253A%252F%252Ft4.liverail.com%252F%253Fmetric%253Dcsync%2526p%253D3016%2526s%253D(NM-UserID)]]></Impression>
<Impression><![CDATA[http://t4.liverail.com/?metric=rsync&p=3017&redirect=http%3A%2F%2Fm.xp1.ru4.com%2Factivity%3F_o%3D62795%26_t%3Dcm_rail]]></Impression>
<Impression><![CDATA[http://n.us1.dyntrk.com/adx/lr/sync_lr.php?lrid=97838239447]]></Impression>
<Creatives>
<Creative sequence="1" id="8455">
<NonLinearAds>
<NonLinear width="300" height="60">
<StaticResource creativeType="image/png"><![CDATA[http://cdn.liverail.com/adasset/228/8455/overlay.png]]></StaticResource>
<NonLinearClickThrough><![CDATA[http://t4.liverail.com/?metric=clickthru&pos=1&coid=135&pid=1331&nid=1331&oid=228&olid=2281331&cid=8455&tpcid=&vid=&amid=&cc=default&pp=&vi=0&vv=&sg=&tsg=&pmu=0&pau=0&psz=0&ctx=&tctx=&coty=7&adt=0&did=&buid=&scen=&mca=&mma=&mct=0&url=http%3A%2F%2Fwww.iab.net%2Fguidelines%2F508676%2Fdigitalvideo%2Fvast%2Fvast_xml_samples&trid=53ea9957dc20a5.06241648&bidf=0.00000&bids=0.00000&bidt=1&bidh=0&bidlaf=0&cb=6662.66.104.228.162.0&ver=1&w=&wy=&x=&y=&xy=&redirect=http%3A%2F%2Fwww.liverail.com]]></NonLinearClickThrough>
</NonLinear>
<TrackingEvents>
<Tracking event="acceptInvitation"><![CDATA[http://t4.liverail.com/?metric=accept&pos=1&coid=135&pid=1331&nid=1331&oid=228&olid=2281331&cid=8455&tpcid=&vid=&amid=&cc=default&pp=&vi=0&vv=&sg=&tsg=&pmu=0&pau=0&psz=0&ctx=&tctx=&coty=7&adt=0&did=&buid=&scen=&mca=&mma=&mct=0&url=http%3A%2F%2Fwww.iab.net%2Fguidelines%2F508676%2Fdigitalvideo%2Fvast%2Fvast_xml_samples&trid=53ea9957dc20a5.06241648&bidf=0.00000&bids=0.00000&bidt=1&bidh=0&bidlaf=0&cb=6662.66.104.228.162.0&ver=1&w=&wy=&x=&y=&xy=]]></Tracking>
<Tracking event="collapse"><![CDATA[http://t4.liverail.com/?metric=minimize&pos=1&coid=135&pid=1331&nid=1331&oid=228&olid=2281331&cid=8455&tpcid=&vid=&amid=&cc=default&pp=&vi=0&vv=&sg=&tsg=&pmu=0&pau=0&psz=0&ctx=&tctx=&coty=7&adt=0&did=&buid=&scen=&mca=&mma=&mct=0&url=http%3A%2F%2Fwww.iab.net%2Fguidelines%2F508676%2Fdigitalvideo%2Fvast%2Fvast_xml_samples&trid=53ea9957dc20a5.06241648&bidf=0.00000&bids=0.00000&bidt=1&bidh=0&bidlaf=0&cb=6662.66.104.228.162.0&ver=1&w=&wy=&x=&y=&xy=]]></Tracking>
</TrackingEvents>
</NonLinearAds>
</Creative>
<Creative sequence="1" id="8455">
<CompanionAds>
<Companion width="300" height="60">
<StaticResource creativeType="image/jpeg"><![CDATA[http://cdn.liverail.com/adasset/228/8455/300x60.jpg]]></StaticResource>
<TrackingEvents>
<Tracking event="creativeView"><![CDATA[http://t4.liverail.com/?metric=companion&pos=1&coid=135&pid=1331&nid=1331&oid=228&olid=2281331&cid=8455&tpcid=&vid=&amid=&cc=default&pp=&vi=0&vv=&sg=&tsg=&pmu=0&pau=0&psz=0&ctx=&tctx=&coty=7&adt=0&did=&buid=&scen=&mca=&mma=&mct=0&url=http%3A%2F%2Fwww.iab.net%2Fguidelines%2F508676%2Fdigitalvideo%2Fvast%2Fvast_xml_samples&trid=53ea9957dc20a5.06241648&bidf=0.00000&bids=0.00000&bidt=1&bidh=0&bidlaf=0&cb=6662.66.104.228.162.0&ver=1&w=&wy=&x=&y=&xy=]]></Tracking>
</TrackingEvents>
<CompanionClickThrough><![CDATA[http://t4.liverail.com/?metric=cclickthru&pos=1&coid=135&pid=1331&nid=1331&oid=228&olid=2281331&cid=8455&tpcid=&vid=&amid=&cc=default&pp=&vi=0&vv=&sg=&tsg=&pmu=0&pau=0&psz=0&ctx=&tctx=&coty=7&adt=0&did=&buid=&scen=&mca=&mma=&mct=0&url=http%3A%2F%2Fwww.iab.net%2Fguidelines%2F508676%2Fdigitalvideo%2Fvast%2Fvast_xml_samples&trid=53ea9957dc20a5.06241648&bidf=0.00000&bids=0.00000&bidt=1&bidh=0&bidlaf=0&cb=6662.66.104.228.162.0&ver=1&w=&wy=&x=&y=&xy=&redirect=http%3A%2F%2Fwww.liverail.com]]></CompanionClickThrough>
</Companion>
<Companion width="300" height="250">
<StaticResource creativeType="image/jpeg"><![CDATA[http://cdn.liverail.com/adasset/228/8455/300x250.jpg]]></StaticResource>
<TrackingEvents>
<Tracking event="creativeView"><![CDATA[http://t4.liverail.com/?metric=companion&pos=1&coid=135&pid=1331&nid=1331&oid=228&olid=2281331&cid=8455&tpcid=&vid=&amid=&cc=default&pp=&vi=0&vv=&sg=&tsg=&pmu=0&pau=0&psz=0&ctx=&tctx=&coty=7&adt=0&did=&buid=&scen=&mca=&mma=&mct=0&url=http%3A%2F%2Fwww.iab.net%2Fguidelines%2F508676%2Fdigitalvideo%2Fvast%2Fvast_xml_samples&trid=53ea9957dc20a5.06241648&bidf=0.00000&bids=0.00000&bidt=1&bidh=0&bidlaf=0&cb=6662.66.104.228.162.0&ver=1&w=&wy=&x=&y=&xy=]]></Tracking>
</TrackingEvents>
<CompanionClickThrough><![CDATA[http://t4.liverail.com/?metric=cclickthru&pos=1&coid=135&pid=1331&nid=1331&oid=228&olid=2281331&cid=8455&tpcid=&vid=&amid=&cc=default&pp=&vi=0&vv=&sg=&tsg=&pmu=0&pau=0&psz=0&ctx=&tctx=&coty=7&adt=0&did=&buid=&scen=&mca=&mma=&mct=0&url=http%3A%2F%2Fwww.iab.net%2Fguidelines%2F508676%2Fdigitalvideo%2Fvast%2Fvast_xml_samples&trid=53ea9957dc20a5.06241648&bidf=0.00000&bids=0.00000&bidt=1&bidh=0&bidlaf=0&cb=6662.66.104.228.162.0&ver=1&w=&wy=&x=&y=&xy=&redirect=http%3A%2F%2Fwww.liverail.com]]></CompanionClickThrough>
</Companion>
</CompanionAds>
</Creative>
</Creatives>
<Extensions />
</InLine>
</Ad>
</VAST>
<!-- 321 US_NEWJERSEY_NEWYORK_METUCHEN 08840 -->
</content>
</ad>
</boxb>
XML;
?>
If you want to get the XML-data, use asXML(),
echo $boxb->ad[0]->content->asXML();
And if you want to create your own XML document, you could use for example,
$myXML = new SimpleXMLElement($boxb->ad[0]->content->asXML());
echo $myXML->asXML();
Which would echo,
<!--?xml version="1.0"?-->
<content>
...
</content>
<?php
include 'boxb.php';
// Load string and parse as XML
$boxb = simplexml_load_string($xmlstr);
// Extract "content" element from loaded XML
$content = $boxb->ad->content;
// Convert extracted info into XML
$new_xml = $content->asXML();
// Send a header tag to the browser, stating that this info is XML
header('Content-type: application/XML');
// Print the actual XML
echo $new_xml;
?>
Related
I've to extract some data from a xml file.
In this file there are some tags that contains CDATA content and I don't try to extract this contents.
The file is like this:
<treeplat>
<ad>
<id>965192-VR</id>
<region>VT</region>
<description>
<![CDATA[
Orte scalo. Vicinissimo alla stazione, in zona tranquilla e panoramica, proponiamo appartamento di recente costruzione così composto: ingresso, salone con ampio angolo cottura e balcone, disimpegno, camera matrimoniale con balcone, cantina e posto auto.
]]>
</description>
<pictures>
<picture>
<picture_url>
<![CDATA[
http://www.immobile.net/media/foto/1440/9f352078-885d-4281-a36d-1d22b3cbdcd9-x.jpg
]]>
</picture_url>
</picture>
<picture>
<picture_url>
<![CDATA[
http://www.immobile.net/media/foto/1440/992a5c0f-62dd-48f2-8c41-9b8ee9e06ca9-x.jpg
]]>
</picture_url>
</picture>
<picture>
<picture_url>
<![CDATA[
http://www.immobile.net/media/foto/1440/a61b4705-ed0a-494b-86fc-e92bb4c916e7-x.jpg
]]>
</picture_url>
</picture>
<picture>
<picture_url>
<![CDATA[
http://www.immobile.net/media/foto/1440/d1817d53-51fa-43dc-baf9-d3457963e694-x.jpg
]]>
</picture_url>
</picture>
<picture>
<picture_url>
<![CDATA[
http://www.immobile.net/media/foto/1440/8299cd3e-f253-4c83-9629-fb77131a2efb-x.jpg
]]>
</picture_url>
</picture>
</pictures>
</ad>
</treeplat>
I parse the xml file in this way:
$xml = simplexml_load_file(storage_path('app'.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.$percorso_file.'test.xml'));
foreach ($xml->ad as $immobile) {
...
}
My problem is tag. I try to extract the first only using this code:
$picture_url_1 = (string)$immobile->pictures->picture->picture_url
but I don't try to extract every picture_url.
How can I parse all the pictures tag?
Many thank's!
you are looping over the wrong variable. what you need is:
$pictures = $xml->ad->pictures->picture;
foreach ($pictures as $picture) {
echo $picture->picture_url;
}
(you can replace echo with whatever command you need)
Gilad almost had it!
$pictures = $xmlData->ad->pictures;
foreach($pictures as $picture)
{
foreach($picture as $pic)
{
echo (string) $pic->picture_url;
}
}
https://3v4l.org/990NR
Having a xml file so formed:
<chapter id="1">
<text line="1"> <p>HTML content 1</p> </text>
<text line="2"> <q>HTML<q> content 2 </text>
<text line="3"> HTML <b>content 3<b> </text>
</chapter>
Using DOMDocument, what query i can use for get all content associated to <chapter id="1">...</chapter> with HTML tag included? Having so as output something as:
<p>HTML content 1</p>
<q>HTML<q> content 2
HTML <b>content 3<b>
PS: As from note, i think which question ask something of different. Just i ask if is possible and how process a content inside a node ignoring html-tag if present when not is possible modify original xml.
Your xml string is not valid, you must convert content in text node to htmlEntities first, example:
$textContent = htmlentities($text);
After that, we have:
$xmlText = '<chapter id="1">
<text line="1"> <p>HTML content 1</p> </text>
<text line="2"> <q>HTML<q> content 2 </text>
<text line="3"> HTML <b>content 3<b> </text>
</chapter>';
Now we just need to use SimpleXMLElement to parse:
$xmlObject = new SimpleXMLElement($xmlText);
$items = $xmlObject->xpath("text");
foreach ($items as $item){
echo html_entity_decode($item);
}
Update 1
In case you can't change your XML string, you need to use regex instead of htmlDom:
function get_tag_contents( $tag, $xml ) {
preg_match_all( "#<$tag .*?>(.*?)</$tag>#", $xml, $matches );
return $matches[1];
}
$invalidXml = '<chapter id="1">
<text line="1"> <p>HTML content 1</p> </text>
<text line="2"> <q>HTML<q> content 2 </text>
<text line="3"> HTML <b>content 3<b> </text>
</chapter>';
$textContents = get_tag_contents( 'text', $invalidXml );
foreach ( $textContents as $content ) {
echo $content;
}
want to make loop and Parsing XML CDATA
my XML
<?xml version="1.0"?>
<photos>
<photo image="images/1.jpg" url="http://LINKHERE" target="_blank" id="1">
</photo>
<photo image="images/1.jpg" url="http://LINKHERE" target="_blank" id="2">
</photo>
</photos>
my code
for ($x = 1; $x <= 10; $x++) {
$dom=new DOMDocument();
$xml='images.xml';
$dom->load($xml);
$xp = new DomXPath($dom);
//$item_content = $xp->query("//*[#id = $x]");
foreach ($dom->getElementsByTagName('photos') as $item) {
$cdata=$dom->createCDATASection('<head>test'.$x.'</head><body></body>');
$item->getElementsByTagName('photo')->item(0)->appendChild($cdata);
}
$dom->save($xml);
}
but the result
<photo image="images/1.jpg" url="http://LINKHERE" target="_blank" id="1">
<![CDATA[<head>test1</head><body></body><head>test2</head><body></body><head>test3</head><body></body>
<head>test4</head><body></body><head>test5</head><body></body>
<head>test6</head><body></body><head>test7</head>
<body></body><head>test8</head><body></body><head>test9</head><body></body>]]><![CDATA[<head>test10</head><body>
</body>]]></photo>
<photo image="images/2.jpg" url="http://http://LINKHERE" target="_blank" id="2">
</photo>
i want it be this
<photo image="images/1.jpg" url="http://LINKHERE" target="_blank" id="1">
<![CDATA[<head>test1</head><body></body>]]></photo>
<photo image="images/2.jpg" url="http://http://LINKHERE" target="_blank" id="2">
<![CDATA[<head>test2</head><body></body>]]></photo>
i want move on loop by id
i try many times but no way , i think i have a problem on my loop
need some help here
You want to append CData on each photo element, so you should loop through photo instead of photos, for example :
$raw = <<<XML
<photos>
<photo image="images/1.jpg" url="http://LINKHERE" target="_blank" id="1">
</photo>
<photo image="images/1.jpg" url="http://LINKHERE" target="_blank" id="2">
</photo>
</photos>
XML;
$dom = new DOMDocument();
$dom->loadXML($raw);
$x = 1;
foreach ($dom->getElementsByTagName('photo') as $item) {
$cdata=$dom->createCDATASection('<head>test'.$x.'</head><body></body>');
$item->appendChild($cdata);
$x++;
}
echo $dom->saveXML($xml);
eval.in demo
output :
<?xml version="1.0"?>
<photos>
<photo image="images/1.jpg" url="http://LINKHERE" target="_blank" id="1">
<![CDATA[<head>test1</head><body></body>]]></photo>
<photo image="images/1.jpg" url="http://LINKHERE" target="_blank" id="2">
<![CDATA[<head>test2</head><body></body>]]></photo>
</photos>
Try this code
<?php
$dom=new DOMDocument();
$xml='images.xml';
$dom->load($xml);
$xp = new DomXPath($dom);
$i = 0;
foreach ($dom->getElementsByTagName('photo') as $item) {
$cdata=$dom->createCDATASection('<head>test'.($i+1).'</head><body></body>');
$item->appendChild($cdata);
$i ++;
}
$dom->save($xml);
I'm trying to display the biggest image url returned from an xml result. So far the largest returned is 400 high so I hardcoded 400 in. If possible I would like to select just the largest in case in the future I get results that don't have a 400 height image in them.
I've tried
$x = file_get_contents($url);
$xml = simplexml_load_string($x);
$imageURL=$xml->categories->category->items->product->images->image[#height='400']->sourceURL;
Which gives me "syntax error, unexpected '=', expecting ']'".
And I also tried:
$imageURL= $xml->xpath("/categories/category/items/producct/images/image[#height='400']/sourceURL");
But got a bad link.
Here is the XML:
<images>
<image available="true" height="100" width="100">
<sourceURL>
Someurl.com
</sourceURL>
</image>
<image available="true" height="200" width="200">
<sourceURL>
Someurl.com
</sourceURL>
</image>
<image available="true" height="300" width="300">
<sourceURL>
Someurl.com
</sourceURL>
</image>
<image available="true" height="400" width="400">
<sourceURL>
Someurl.com
</sourceURL>
</image>
<image available="true" height="399" width="400">
<sourceURL>
Someurl.com
</sourceURL>
</image>
</images>
Any ideas?
->image[#height='400'] is a direct PHP array reference. This'd be interpreted as supressing errors (#) on a defined() constant (height), and trying to set its value via an assignment ='400'.
For your xpath version, remember that an xpath query returns a DOMNodeList, not an actual DOMElement. To get the URLs you need from the query results, you have to ierate over the node list:
$nodes = $xpath->query(...) {
foreach($nodes as $node) {
$url = $node->nodeValue;
}
Below code might help...
$xmlSQLProcedures = new DOMXPath($xmlSQLProcedures);
$strProcedureName = $xmlSQLProcedures->query("//SQLProcedure[#ID='$sSQLProcedureID']")->item(0)->nodeValue;
$nodeParameters = $xmlSQLProcedures->query("//SQLProcedure[#ID='$sSQLProcedureID']/Parameters/Parameter");
$ParamCount = $nodeParameters->length-1;
for ($i=0;$i<=$ParamCount;$i++) {
echo $nodeParameters->item($i)->getAttribute("Name").'<br>';
}
<?xml version="1.0" encoding="UTF-8"?>
<SQLProcedures>
<!-- ********** FOR KEYWORD IN LOCAL LANGUAGE ************* -->
<SQLProcedure ID="001070001">
<Name>P_ManipulateKeywordsInLL</Name>
<Parameters>
<Parameter Name="LanguageId"/>
<Parameter Name="KeywordId"/>
<Parameter Name="KeywordInLL"/>
<Parameter Name="ActionFor"/>
<Parameter Name="KeywordInLLId"/>
<Parameter Name="Keyword"/>
<Parameter Name="KeywordList"/>
<Parameter Name="SessionId"/>
<Parameter Name="WarehouseId"/>
</Parameters>
</SQLProcedure>
</SQLProcedures>
I'm trying to use an API with the following XML:
<movies>
<movie>
<images>
<image type="poster" url="http://cf1.imgobject.com/posters/b7a/4bc91de5017a3c57fe00bb7a/i-am-legend-original.jpg" size="original" width="675" height="1000" id="4bc91de5017a3c57fe00bb7a"/>
<image type="poster" url="http://cf1.imgobject.com/posters/b7a/4bc91de5017a3c57fe00bb7a/i-am-legend-mid.jpg" size="mid" width="500" height="741" id="4bc91de5017a3c57fe00bb7a"/>
<image type="poster" url="http://cf1.imgobject.com/posters/b7a/4bc91de5017a3c57fe00bb7a/i-am-legend-cover.jpg" size="cover" width="185" height="274" id="4bc91de5017a3c57fe00bb7a"/>
</images>
</movie>
</movies>
Can someone give me an example of the PHP code I should use to get the image url where size="cover"?
Thanks.
SimpleXML can do this quite, for lack of a better word, simply:
$xml = new SimpleXMLElement($str);
$xpath = $xml->xpath("/movies/movie/images/image[#size = 'cover']");
echo $xpath[0]['url'];
Load the xml with a XML Parser, DOMDocument, SimpleXML etc.
http://se.php.net/manual/en/refs.xml.php
Then you can use XPath to select the image.
http://www.w3schools.com/xpath/xpath_syntax.asp
XPath to grab movie with attribute size = cover
/movies/movie/images/image[#size=cover]
Looks like a good tutorial: http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/
<?php
$string = <<<XML
<?xml version='1.0'?>
<movies>
<movie>
<images>
<image type="poster" url="http://cf1.imgobject.com/posters/b7a/4bc91de5017a3c57fe00bb7a/i-am-legend-original.jpg" size="original" width="675" height="1000" id="4bc91de5017a3c57fe00bb7a"/>
<image type="poster" url="http://cf1.imgobject.com/posters/b7a/4bc91de5017a3c57fe00bb7a/i-am-legend-mid.jpg" size="mid" width="500" height="741" id="4bc91de5017a3c57fe00bb7a"/>
<image type="poster" url="http://cf1.imgobject.com/posters/b7a/4bc91de5017a3c57fe00bb7a/i-am-legend-cover.jpg" size="cover" width="185" height="274" id="4bc91de5017a3c57fe00bb7a"/>
</images>
</movie>
</movies>
XML;
$xml = simplexml_load_string($string);
foreach($xml->movie->images->image as $image) {
if(strcmp($image['size'],"cover") == 0)
echo $image['url'];
}
?>
$xml = simplexml_load_string($string2);
foreach($xml->movie->images->image as $image) {
if(strcmp($image['size'],"cover"))
// echo $image['url'];
?>
" width="200px" height="100px">