Page 1 of 1

Another XML question

Posted: Wed Jan 24, 2007 11:30 pm
by phpwalker
I've finally create a small piece of code that will check the pattern of the raw data(plain text), and convert it into XML file type if there's no error.

However, when I wanted to convert the XML file back to the plain text, I have no clue on how to do it.

I've read some SimlpeXML and find some tutorials, there's no tutorial for a beginner like me.

Thanks if someone can guide me throughout this.

Posted: Thu Jan 25, 2007 4:20 am
by Jenk

Posted: Sun Feb 04, 2007 9:32 pm
by phpwalker
Ehm, but I wanted to know how to make this

Code: Select all

...
<name> phpwalker </name>
..
into this

Code: Select all

name: phpwalker
What function is suitable for this?

Posted: Sun Feb 04, 2007 9:36 pm
by alex.barylski
If you knew regex reall well, you could maybe do something like that

Although, I would personally use a DOM which is easy to traverse and reformat your code as required...

Posted: Sun Feb 04, 2007 9:51 pm
by feyd
I'd suggest DOM over regex as well.

Posted: Sun Feb 04, 2007 10:55 pm
by phpwalker
Do you guys mean XML DOM?

What requirement do I need to use XML DOM?

Before that, I also wanted to learn regex, please give me some guidance on that to solve the above problems.

Thanks for the helps.