shop.i.ua

- . XML-, .

:

<?xml version="1.0" encoding="windows-1251"?>
<price date="2007-01-16 16:44">
  <name>eMagazinchik</name>
  <url>http://www.eMagazinchik.com.ua/</url>
  <currency code="UAH"/>
  <region></region>

  <catalog>
    <category id="17"> </category>
    <category id="25" parentID="17"></category>
    <category id="34" parentID="17">DVD-</category>
    <category id="16"></category>
    <category id="19" parentID="16"> </category>
  </catalog>

  <items>
    <item id="138">
      <name> SAMSUNG LE40R71B</name>
      <url>http://www.eMagazinchik.com.ua/backet/?pid=138&amp;id=25&amp;ref=iua</url>
      <price>9576.00</price>
      <categoryId>25</categoryId>
      <image>http://www.eMagazinchik.com.ua/img/138.jpg</image>
      <vendor>Samsung</vendor>
      <description>: , . () 40,    16:9
      </description>
    </item>
  </items>
</price>
		

,

<?xml version="1.0" encoding="windows-1251"?>
		

XML . , "windows-1251".

<price date="2007-01-16 16:44">
		

price

XML-. . date YYYY-MM-DD HH-MM. shop.i.ua , .

<name>eMagazinchik</name>
<url>http://www.eMagazinchik.com.ua/</url>
<currency code="UAH"/>
<region></region>
		

name

C -. , , .

, & " .

url

C -.

& &amp;

currency

code . "USD", "EUR", "UAH".

rate , shop.i.ua, rate  — .  — .

:

<currency code="USD" rate="5.15" /> — , 5.15 /
<currency code="UAH" /> —

region

- . : "", "", "", "", "", "", "", "-", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "".

.

( , ):

<region></region>
<region></region>

<catalog>
  <category id="17"> </category>
  <category id="25" parentID="17"></category>
  <category id="34" parentID="17">DVD-</category>
  <category id="16"></category>
  <category id="19" parentID="16"> </category>
</catalog>
		

catalog

, ( ).

category

.

id ( ) id , 1 2147483647. , id , .

parentID id , 1 2147483647. parentID ,  — .

 — .

<items>
  <item id="138">
    <name> SAMSUNG LE40R71B</name>
    <url>http://www.eMagazinchik.com.ua/backet/?pid=138&amp;id=25&amp;ref=iua</url>
    <price>9576.00</price>
    <categoryId>25</categoryId>
    <image>http://www.eMagazinchik.com.ua/img/138.jpg</image>
    <vendor>Samsung</ vendor >
    <description>: , . () 40,    16:9
    </description>
  </item>
</items>
		

items

( ).

item

id ( ) , 1 2147483647. , id , . , , crc32

name

(150 ), , , . .

url

-. . & &amp; URL &amp;ref=iua.

price

, ,  — . , . , cid, <price cid="EUR">

categoryId

id <catalog>, .

image

C gif, jpg png. . . .

vendor

. .

description

( 65535 ). .

HTML-:

<p>, <br>, <li>, <table>, <tr>, <td>, <ol>, <ul>, <nobr>.

, shop.i.ua

http ftp. (), , . shop.i.ua , , .

PHP

<?
function toXML($str)
{
  return htmlspecialchars($str, ENT_QUOTES);
}
Header("Content-Type: \"text/xml\"; charset=windows-1251");
echo '<?xml version="1.0" encoding="windows-1251"?>';
?>
<price date="<?=date('Y-m-d H:i')?>">
<name>eMagazinchik</name>
<url>http://www.eMagazinchik.com.ua/</url>
<currency code='USD'/>
  <region></region>
  <catalog>
<?
foreach ($categories as $row)
{
  echo '<category id="', $row['id'], '" parentID="', $row['parentID'], '">',
  toXML($row['name']), '</category>';
}
?>
  </catalog>
  <items>
<?
$res = mysql_query("SELECT
id, name, catalogID, description, image_path, extern_url, price, vendor
FROM price WHERE price_uah!=0");
while($row = mysql_fetch_array($res))
{
?>
    <item id="<?=(int)$row['id']?>">
      <name><?=toXML($row['name'])?></name>
      <categoryId><?=(int)$row['catalogID']?></categoryId>
      <price><?=(float)$row['price']?></price>
      <url><?=toXML($row['extern_url'])?></url>
      <image><?=toXML($row['image_path'])?></image>
      <vendor><?=toXML($row['vendor'])?></vendor>
      <description><?=toXML($row['description'])?></description>
    </item>
<?
}
?>
  </items>
</price>
		

():
: