Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> DomDocument, możliwość wstawiania pustej linii ?
zzeus
post
Post #1





Grupa: Zarejestrowani
Postów: 441
Pomógł: 71
Dołączył: 3.09.2007
Skąd: wrocław

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


Witam, mam pytanko. Czy ktoś się orientuje czy za pomocą DomDocument można wstawiać puste linie do generowanego pliku xml oraz znaków tabulacji, chodzi o to, żeby plik wyglądał tak

  1. <element>jakis tekst</element>\tab
  2. <element1>jakis tekst</element1>\enter
  3.  
  4. <element2>jakis tekst</element2>


--------------------
Go to the top of the page
+Quote Post
Cysiaczek
post
Post #2





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Można wymusić formatowanie dokumentu poprzez
  1. <?php
  2. $dom = new DOMDocument();
  3. $dom->formatOutput=true;
  4. $dom->preserveWhiteSpace=false;
  5. ?>

Z tymi tabami, to nie kapuję.

Pozdrawiam


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
zzeus
post
Post #3





Grupa: Zarejestrowani
Postów: 441
Pomógł: 71
Dołączył: 3.09.2007
Skąd: wrocław

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


Z tab chodzi o to żeby po elemencie był znak tabulacji.
A jak wstawić pustą linie .... bo coś nie bardzo kumam :/


--------------------
Go to the top of the page
+Quote Post
Cysiaczek
post
Post #4





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




To coś pokręciłem heh smile.gif
Pustą powiadasz... Wstaw node typu TEXT i jako wartość wpisz \n. tak samo dla tabulacji, tylko \t

Pozdrawiam.


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
zzeus
post
Post #5





Grupa: Zarejestrowani
Postów: 441
Pomógł: 71
Dołączył: 3.09.2007
Skąd: wrocław

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


Ustawiłem

  1. <?php
  2. $dom->preserveWhiteSpace=false;
  3. ?>


ale niestety nadal jak tworzę jakiś element to on nie uwzględnia tabulacji zawartych w tekście do niego zapisanym


--------------------
Go to the top of the page
+Quote Post

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: 20.08.2025 - 10:54