$vid = 100;
$tid = 999;
$name = "Категория объявления";
$handle = fopen("board.csv", "r");
if ($handle) {
echo "
<?xml
version=\
"1.0\" standalone=\"no\"?>\n";
echo "<!DOCTYPE taxonomy SYSTEM \"taxonomy.dtd\">\n";
echo "<vocabulary>\n";
echo "<vid>".$vid."</vid>";
echo "<name>".$name."</name>";
echo "<description>description</description>";
echo "<help>help</help>";
echo "<relations>0</relations>";
echo "<hierarchy>1</hierarchy>";
echo "<multiple>0</multiple>";
echo "<required>1</required>";
echo "<tags>0</tags>";
echo "<module>taxonomy</module>";
echo "<weight>0</weight>";
echo "<nodes>autos</nodes>";
while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
$tid++;
$num = count($data);
echo "<term>";
echo "<tid>".$tid."</tid>";
echo "<vid>".$vid."</vid>";
echo "<name>".$data[0]."</name>";
echo "<description>description</description>";
echo "<weight>0</weight>";
echo "<depth>0</depth>";
echo "<parent>0</parent>";
echo "</term>";
if ( $num > 1 ) {
$parent_tid = $tid;
$weight = -7;
$tid++;
for ($c=1; $c < $num; $c++) {
echo "<term>";