Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Write xml from string

Posted on 2011-03-10
4
Medium Priority
?
544 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

610 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