Web Hosting Talk







View Full Version : technical question!


HOST18.com
09-25-2001, 10:51 AM
i was wondering if any of you guys has any experience with the following:

i have to create an application that:
1. receives a log in XML format (i do not have to send the log, just be able to receive it)
2. put the contents of the XML file in a MySQL database.

i have to use PHP to do this.

what i am thinking of doing (and i dont know if this is possible) is:
A. collect the log like i'd collect any "form" using PHP
B. use the PHP Sablotron extension to enable XSLT to convert the XML file into SQL
C. Use the SQL to put the important information into the database

MY question is: will this work?? also, do you know how I do step C?

Thanks!!!!!!!!!!!!!!!!!

MattF
09-25-2001, 12:13 PM
You wouldn't use XSLT to transform an xml document into SQL statement, XSLT is designed for converting XML documents to other XML format document or XHTML (strict HTML).

You would load the file or log you want to use into an XML parser and then extract the data, perhaps looping through it, and then generate the SQL statements that way. Open a database connection in the script, execute the SQL statements then close the database connection.

I can't be of any more help, I use JSP for that type of thing rather than PHP.

Originally posted by HOST18.com
i was wondering if any of you guys has any experience with the following:

i have to create an application that:
1. receives a log in XML format (i do not have to send the log, just be able to receive it)
2. put the contents of the XML file in a MySQL database.

i have to use PHP to do this.

what i am thinking of doing (and i dont know if this is possible) is:
A. collect the log like i'd collect any "form" using PHP
B. use the PHP Sablotron extension to enable XSLT to convert the XML file into SQL
C. Use the SQL to put the important information into the database

MY question is: will this work?? also, do you know how I do step C?

Thanks!!!!!!!!!!!!!!!!!

HOST18.com
09-25-2001, 12:38 PM
i appreciate your help... you've saved me a lot of time :D