Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [XML][PHP]Problem z tworzeniem pliku XML
Vion
post
Post #1





Grupa: Zarejestrowani
Postów: 112
Pomógł: 2
Dołączył: 27.06.2008

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


Mam taki kod
  1. interface XML{
  2. function generate();
  3. }
  4. class XMLfromFILE implements XML{
  5. private $_file;
  6.  
  7. public function __construct(){
  8. // $this->_file=$obj;
  9. }
  10. function generate(){
  11. $gen = new XMLWriter();
  12. $gen->openMemory();
  13. $gen->setIndent(true);
  14. $gen->setIndentString(" ");
  15. $gen->startDocument("1.0","UTF-8");
  16. $gen->startElement('PLIK');
  17. $gen->writeAttribute("Nazwa",'pliczek');
  18. $gen->endElement();
  19. $gen->endDocument();
  20. header("Content-type: text/xml");
  21. echo $gen->outputMemory();
  22.  
  23. }
  24. }


następnie gdy wywołam na obiekcie metodę generate() dostaje taki bład. To jest związane z header ? Ma ktoś pomysł jak to rozwiązać ?

This page contains the following errors:

error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 14.09.2025 - 22:43