Jump to content

Is there an easy way to convert data to xml in PHP?


Recommended Posts

1. MY application gets input data from files in the following fomats

- xml format 1

- xml format 2

- csv

These should get converted to my defined xml format

 

2. An example scenario

- Incoming data has an element custId. My application has a matching element customerid.

 

Is the following solution right or is there a better way?

- create xsd of my final format (is there any available feature or code for this in PHP?)

- create xsd at runtime from the incoming format (is there any available feature or code for this in PHP?)

- write code to create a php screen to display elements of the xsd on the left and right (is there any available feature or code for this in PHP?)

- give an option to map left fields with right

- when clicked on a convert button, convert the incoming xml file to the matched format and create a new file as output

 

I can do the complete steps from scratch by writing a lot of code and parsing each element of both the files. But are there any time saving or smart suggestions to do it better?

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.