xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: "Johann Wilfling" <wj313 AT gmx.net>
- To: xom-interest AT lists.ibiblio.org
- Subject: [XOM-interest] Mapping XOM to RDBMS
- Date: Tue, 16 Nov 2004 14:25:25 +0100 (MET)
Hi,
I'm fairly new to XOM so I wanted to ask the great XOM community to give
me some pointers, thoughts or design patterns how to map an existing
in-memory tree (e.g. XOM) to RDBMS.
Mostly all nodes in that tree are instantiated with the same class
("Element") and could be distinguished by an attribute typ. Every node has a
list of its children. Futhermore, these node types have to be stored in
different db-tables.
Example: A car consists of severel parts (tires, seats, doors .. ) and is
represented as a XML-file.
<cars>
<car name="car1">
<tires>
<tyre> One </tyre>
<tyre> Two </tyre>
<tyre> Three </tyre>
<tyre> Four </tyre>
</tires>
<seats>
...
</seats>
...
</car>
...
</cars>
So, I've parsed the XML file and generated a XOM tree.
But how do I create a mapping for this in-memory tree with different
db-tables (Car, Tyre, Seat..) and read it again out of it in the same
structure where all nodes are of the same "Element"?
Or is it easier to subclass the "Element"-class and create required real
classes like "Car", "Tyre", "Seat".. and create a mapping with them? But how
do I reconstruct the tree-structure with that?
Thank you all and kind reagards!
--
NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl
GMX DSL-Netzanschluss + Tarif zum supergünstigen Komplett-Preis!
-
[XOM-interest] Mapping XOM to RDBMS,
Johann Wilfling, 11/16/2004
- Re: [XOM-interest] Mapping XOM to RDBMS, Elliotte Harold, 11/16/2004
Archive powered by MHonArc 2.6.24.