Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,388 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,219 people online right now. Registration is fast and FREE... Join Now!




formatting XML using php

 
Reply to this topicStart new topic

formatting XML using php, ........................

eurotrash
post 12 Dec, 2002 - 01:27 PM
Post #1


New D.I.C Head

*
Joined: 5 Nov, 2001
Posts: 0

I'm using php to querrie a mySQL db and then output XML content. So far so good. I need a way to format it properly, with indents, white spaces and etc. becasue I'm loading it into a flash movie.

the XML I'm currently getting is one long line, slowpace.org/ltc/thing.php and view the source.

I need soemthing more like this slowpace.org/ltc/tree_nested.xml

any ideas on where to start.

thanks.
User is offlineProfile CardPM

Go to the top of the page

Noffke
post 12 Dec, 2002 - 01:43 PM
Post #2


D.I.C Regular

***
Joined: 9 Aug, 2002
Posts: 497


My Contributions


I know nothing of php, is it object oriented or ney?

if php is object oriented I can help conceptually........
I just got done writing an XML writer in java and currently working on one in C++.


Also, I couldn't view the XML in IE, it says there is a duplicate attribute in line 1.
User is offlineProfile CardPM

Go to the top of the page

eurotrash
post 12 Dec, 2002 - 01:53 PM
Post #3


New D.I.C Head

*
Joined: 5 Nov, 2001
Posts: 0

okay:
try the links again... I forgot to uplaod the working files....

php is object oriented and it's syntax is a lot like C++.
User is offlineProfile CardPM

Go to the top of the page

eurotrash
post 12 Dec, 2002 - 02:36 PM
Post #4


New D.I.C Head

*
Joined: 5 Nov, 2001
Posts: 0

nevermind I figured it out.... just had to add an new line character at the end of the echo statment

"<TREE ACTION=\"URL\" LINK=\"$link\" TARGET=\"blank\">$title</TREE>\n";
User is offlineProfile CardPM

Go to the top of the page

Noffke
post 13 Dec, 2002 - 06:17 AM
Post #5


D.I.C Regular

***
Joined: 9 Aug, 2002
Posts: 497


My Contributions


ahhhh, it turned out easier than expected. sorry, I had a crisis arise in my cube, and then I had to go to a soccer game......
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 07:00AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month