Store XML in a Database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stefan Garde

    Store XML in a Database

    I need to figure out how you store a XML file (and its data) down in a
    Access database, by the help of SQL.

    I have tried looking through the net, but havent been very lucky (only found
    a course on how to do it, which was in america somewhere i think).

    I work in Java, so would be very happy if someone had some code example from
    that or a link. But anything is acceptable really.

    Hope to get some response

    Regards,
    Stefan



  • Doyle

    #2
    Re: Store XML in a Database

    "Stefan Garde" <stefangarde@ho tmail.com> wrote in message news:<3f955ad5$ 0$54832$edfadb0 [email protected]. tele.dk>...[color=blue]
    > I need to figure out how you store a XML file (and its data) down in a
    > Access database, by the help of SQL.[/color]

    Do you need to just store the XML string or convert it into its
    constituent parts and store it?

    If you need to break it into its parts you should first figure out how
    the XML file maps to the database. With any luck you should have some
    level of entity/table mapping.

    After loading your document into a XML-DOM parser with JAXP
    (http://java.sun.com/xml/jaxp/index.html) or Xerces
    (http://xml.apache.org/xerces2-j/index.html), you should be able to
    recursively traverse your document. Once you are at the leaf nodes you
    should be able to begin to enter the data into the database with
    simple SQL statements.

    I hope that is enough to get you started.

    mypetrock

    Comment

    • Gregory Vaughan

      #3
      Re: Store XML in a Database

      If you know how to write XPath expressions, we have a small shareware tool
      that can read XML and store different element and attribute values to a
      database. It is a Win32 executable, and can store into Access via ODBC.





      "Stefan Garde" <stefangarde@ho tmail.com> wrote in message
      news:3f955ad5$0 $54832$edfadb0f @dread11.news.t ele.dk...[color=blue]
      > I need to figure out how you store a XML file (and its data) down in a
      > Access database, by the help of SQL.
      >
      > I have tried looking through the net, but havent been very lucky (only[/color]
      found[color=blue]
      > a course on how to do it, which was in america somewhere i think).
      >
      > I work in Java, so would be very happy if someone had some code example[/color]
      from[color=blue]
      > that or a link. But anything is acceptable really.
      >
      > Hope to get some response
      >
      > Regards,
      > Stefan
      >
      >
      >[/color]


      Comment

      Working...