locked
xml query RRS feed

  • Question

  • Hi, I'm a student

    I need to write a java program, which can convert any XML file to SQL database (i.e. MySQL, Postgres).
    BUT
    I don't have any idea, how to do that. Because XML files can be quite complex: i.e:
     
    <a>
    <b>
    <c>
    Something here
    </c>
    </b>
    </a>

    My idea is: <a > is table in database, <b > is column, and <c > ...... Exactly! WHAT TO DO with tags which deepth is greater than three?
    Any suggestions? Plz help
    Thursday, November 22, 2007 4:22 PM

All replies

  • Hi,

    XML is basically a hierarchical structure and there are available parsers as APIs in Java. It would be better if you get some knowledge about xml standards like SAX and DOM and use the JAXP Parser.
    Java API for XML Parsing. Java API for XML Parsing (JAXP) Optional Package provides basic functionality for reading, manipulating, and generating XML documents through pure Java APIs.
    Wednesday, November 28, 2007 8:07 AM