Convert XSD into SQL relational tables

1,308

Solution 1

Altova's XML Spy has a feature that will generate SQL DDL Script from an XSD file. XML Spy will cost you some money though.

Interestingly enough, a developer used a really clever trick of using an XSLT translation to create the DDL script from an XSD file. They have outlined it in two parts here and here.

I might have to try this out myself for future use...

EDIT: Just found this question asked previously here...

Solution 2

There is a command-line tool called XSD2DB, that generates database from xsd-files, available at sourceforge.

For more info: please refer to this existing question How can I create database tables from XSD files?

Share:
1,308
sina ardehali
Author by

sina ardehali

Updated on August 13, 2020

Comments

  • sina ardehali
    sina ardehali almost 4 years

    when i write :

    signed int a = 4;
    

    is my computer using 2's representation?

    because if my computer use 2’s complement representation to represent number 4, this is what will happen on a 8 bit machine:

    binary value of 4 : 0000 0100

    2’s complement become: 1111 1011

    add 1: 1111 1100

    but i read that when the most signficant bit is 1 , your number is negative. but here my most significant bit is 1 and my number is 4 . it is not -4.

    why my number 4 has a 1 as the most significant bit?

    • Yahoo Serious
      Yahoo Serious almost 11 years
    • duffymo
      duffymo over 7 years
      2's complement is for subtraction; you don't use it to perform addition.
    • Some programmer dude
      Some programmer dude over 7 years
      You might want to read more about two's complement. Also what you call 2's complement (1111 1011) is not actually two's complement but one's complement.
    • Weather Vane
      Weather Vane over 7 years
      @Someprogrammerdude - just OP's poor phrasing as he then adds the 1.
    • Some programmer dude
      Some programmer dude over 7 years
      And two answer your question, two's complement is to represent negative numbers. Positive numbers are represented as is.
    • Weather Vane
      Weather Vane over 7 years
      Your number was 4, but by perfoming the 2's complement on 4 you made it -4 in this notation, it does not remain the same number.