Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [XML][PHP]PHP do XML, znacznik image z "href"
Delleg
post
Post #1





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 22.01.2013

Ostrzeżenie: (0%)
-----


Najpierw kod

  1. $xml=new Domdocument("1.0" );
  2. $xml->encoding="UTF-8";
  3. $xml->formatOutput=true;
  4. $coffins=$xml->createElement("coffins");
  5. $xml->appendChild($coffins);
  6.  
  7. $size = $row['size'];
  8. $coffin=$xml->createElement("coffin");
  9. //$coffin->setAttribute("image", $winpath);
  10. $coffin->setAttribute("Kategorie", $cat);
  11. $coffins->appendChild($coffin);
  12. $name=$xml->createElement("name",$name);
  13. $coffin->appendChild($name);
  14. $image=$xml->createElement("PSD", $winpath );
  15. //$coffin->appendChild($image);
  16. $xcat=$xml->createElement("category",$cat);
  17. $coffin->appendChild($xcat);
  18. $xtype=$xml->createElement("type",$type);
  19. $coffin->appendChild($xtype);
  20. $xverb=$xml->createElement("veneered",$verb);
  21. $coffin->appendChild($xverb);
  22. $xsize=$xml->createElement("Überbreite",$size);
  23. $coffin->appendChild($xsize);


powyższy kod tworzy plik XML (podaję tylko wycinek)

  1. <coffin Kategorie="Kiefer">
  2. <name>No. 29 Kiefer Eiche furniert mit Palme Ornament</name>
  3. <image>href="file:///coffins/coffin_id_1.psd"</image>
  4. <category>Kiefer</category>
  5. <type>Furniert</type>
  6. <veneered>Eiche</veneered>
  7. <Size>2000x700x640</Size>
  8. </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
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 16:07