Najpierw kod
$xml=new Domdocument("1.0" );
$xml->encoding="UTF-8";
$xml->formatOutput=true;
$coffins=$xml->createElement("coffins");
$xml->appendChild($coffins);
$size = $row['size'];
$coffin=$xml->createElement("coffin");
//$coffin->setAttribute("image", $winpath);
$coffin->setAttribute("Kategorie", $cat);
$coffins->appendChild($coffin);
$name=$xml->createElement("name",$name);
$coffin->appendChild($name);
$image=$xml->createElement("PSD", $winpath );
//$coffin->appendChild($image);
$xcat=$xml->createElement("category",$cat);
$coffin->appendChild($xcat);
$xtype=$xml->createElement("type",$type);
$coffin->appendChild($xtype);
$xverb=$xml->createElement("veneered",$verb);
$coffin->appendChild($xverb);
$xsize=$xml->createElement("Überbreite",$size);
$coffin->appendChild($xsize);
powyższy kod tworzy plik XML (podaję tylko wycinek)
<coffin Kategorie="Kiefer">
<name>No. 29 Kiefer Eiche furniert mit Palme Ornament</name>
<image>href="file:///coffins/coffin_id_1.psd"</image>
<category>Kiefer</category>
<type>Furniert</type>
<veneered>Eiche</veneered>
<Size>2000x700x640</Size>
</coffin>
Problem w tym że zamiast <image>href="file:///coffins/coffin_id_1.psd"</image> powinno być <image href="file:///coffins/coffin_id_1.psd"/>, jak to wykonać?
Ten post edytował Delleg 8.11.2016, 00:52:07