Solved

Write xml from string

Posted on 2011-03-10
4
517 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 20 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 20 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

740 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