Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]DomDocument, dom document pytanie
--Jurand--
post
Post #1





Goście







Witam mam pewne pytanie .. w momencie gdy dodaje kolejne elementy do dokumentu xml ... powiedzmy

xml->append(xml->createElement('test'));

w koncowym efekcie gdy zapisze plik wszstkie elementy sa w jednej lini ! <element/><element/><element/> ...
czy ktos wie moze jak zrobic by document ladnie sie ukladal czytelnie w postaci
<element/>
<element/>
<element/>

dziekuje
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
--jurand--
post
Post #2





Goście







  1.  
  2. $this->dom = new DOMDocument('1.0', 'utf-8');
  3. $this->dom->preserveWhiteSpace = false;
  4. $this->dom->formatOutput = true;
  5. $this->dom->Load($this->name);
  6.  


uzywam takiego kodu na poczatku a output w pliku ciagle

<test/><test/><test/><test/><test/><test/><test/><test/><test/><test/><test/><test/></content>


Go to the top of the page
+Quote Post

Posty w temacie
- -Jurand-   [PHP]DomDocument   15.04.2011, 16:21:19
- - wookieb   Na samym początku [PHP] pobierz, plaintext $xml-...   15.04.2011, 16:32:07
- - -jurand-   [PHP] pobierz, plaintext   $this->dom = n...   15.04.2011, 16:34:58
- - -Jurand-   hmmmm ...ogolnie za 2gim dodaniem powiodlo sie .. ...   15.04.2011, 16:42:06


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: 15.10.2025 - 05:24