[Ilugc] Help needed

  • From: rajanvn@xxxxxxxxx (Natarajan V)
  • Date: Fri Nov 2 21:59:54 2007

On Nov 2, 2007 2:03 PM, ?????????? <citizenofgnu@xxxxxxxxx> wrote:

I have an xml file and my requirement is to build a mysql table and
push the value of the xml file into the table.
I would request a pointer on how to build a table at run time after
look the xsd file. Is there any straight way tool for solving the
problem, I heard xmlspy solves the problem.

XML Spy costs a fortune.

How often do you get new Schemas and how often do you want to create
these tables? Once during design time or is it in run time? How big is
your schema going to be? Looks like you are doing some B2B stuff?

If you are in the Java world, I would create convert the XSD into a
set of Value Objects (POJO alias beans alias Records/Struct in the
C/C++ world). I would then manually create the tables that map on to
the beans. Java Hibernate does have an option to create the tables
from these beans. But still we do have to code a little. I haven't
tried the last part yet, myself.

I don't prefer to use an automated tool to create a DB Schema using an
XML Schema.  I consider that risky. Consider the different name spaces
and some in-efficient  XSDs that can be given as inputs.  You might
end up creating redundant tables due to a bad XSD. The Table naming
conventions would take you for a ride if you do it
automatically.Sorry, if I sounded a little discouraging.

OOPS... I remembered just now. You work on PHP right? Sorry, I don't
have a direct answer for your question. But the answer that I gave
might help others (may be?). But if you want to understand how to get
a pointer on how to do some "intelligent and manual" mapping between
XSD and DB Schema, I can send you a detailed mail on that?

Regards,
Natarajan

Other related posts: