Federico said:
[top posting fixed]
There is no need to shout at us.
Use an XML parsing module to read the input.
Do stuff to the data.
Use the DBI to write the output.
thank you very much. My hope was that there was a module to update mySQL
database using datas stored in xml file automatically, whitout re-write the
code every time different for heach database and table. nothing of similar?
Federico.
The question would be how would such a module work? XML is essentially
a free format. It a way of representing data in a variety of ways. It
is essentially a "data structure." To write an XML import function
would require a standardization of the structure or layout of the data
(rows, columns, attributes, data, etc.) Or a "protocol" so to speak.
There are two possibilities that I see could perhaps help you in the
short term:
(1) Standardize your XML data structure, use a Perl XML module to read
your data and parse the XML (like XML::Simple), and run the parsed data
through a "handler" that conforms to your standardized data structure.
So you have a parser and a handler. If your structure needs to change,
you just update your handler and you can still import.
(2) Look into using something like XML-RPC or SOAP. (Which is a fine
example in and off itself of "structuring" XML into a standard protocol
-- that's what I'm talking about.) You could write a wrapper that uses
your SSL gateway and calls an XML-RPC service once inside the door to
update your database. XML-RPC is absolutely brainless to implement and
it quite powerful (and quite unsecure, but if you had an SSL front door,
it could be made secure.)
See if these will help you. Your problem is an interesting one. It's
hard not to feel from your description that it perhaps couldn't use some
help in re-architecting, but I'll refrain from sounding too disparaging;
I'm sure it was done as best as it could be conceived.
Chris