?
Solved

Write xml from string

Posted on 2011-03-10
4
Medium Priority
?
532 Views
Last Modified: 2012-05-11
I have what is routine to me in VB but have not been able to accomplish in PHP.
Can someone please give me some code suggestion on how to write the following lines of string to an XML file as per below?

The strings:
Pat,Rafter,30,Aussie
Boris,Becker,17,German
Paul,Raddy,28,Russian

The XML
<doc>
<Record>
  <fname>Pat</fname>
  <lname>Rafter</lname>
  <magicno>30</magicno>
  <village>Aussie</village>
</Record>
<Record>
  <fname>Boris</fname>
  <lname>Becker</lname>
  <magicno>17</magicno>
  <village>German</village>
</Record>
<Record>
  <fname>Paul</fname>
  <lname>Raddy</lname>
  <magicno>28</magicno>
  <village>Russian</village>
</Record>
</doc>
0
Comment
Question by:nepaluz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 39

Accepted Solution

by:
Aaron Tomosky earned 80 total points
ID: 35102423
Simplexmlwriter

Sorry for the lack of pasteable code, the manual is pretty good
0
 
LVL 17

Assisted Solution

by:nepaluz
nepaluz earned 0 total points
ID: 35102549
Honestly, I expressly asked for code suggestion(s).
0
 
LVL 11

Assisted Solution

by:Amar Bardoliwala
Amar Bardoliwala earned 80 total points
ID: 35104960
0
 
LVL 17

Author Closing Comment

by:nepaluz
ID: 35135966
I give up. I expressly requested for code suggestions but got links to .... I basically do not know.

anyway, after a long evening, I managed to get some code from Daniweb. Thanks all who contributed.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question