Mark Birbeck wrote: > > Emin asked: > > > can anyone give me an idea about how to store XML documents on a > > relational database (i.e. ORACLE) > > That depends on how flexible you want to be. You could just create a > large field that contains the whole document, or you could store the > document in a file system and place a reference to it in the DB. Both > solutions make searching a bit tricky, and I would regard them as quite > 'static', since obtaining a smaller part of a document is awkward. > > We use a simple technique where we have a table for attributes and a > table for elements. The attribute table has a join on the element table > to say what element the attribute belongs to, whilst the element has > joins to itself to say who the parent of an element is. This allows us > to store an object-like tree structure, and so generate XML documents > from any point in the tree. > I can see that this is a way to build a tree, but how do you solve the ordering problem? If there are three PARA elements that all have the same SECTION element as parent, how do you figure out which goes first? Another problem is handling mixed content like: <PARA>Just some text containing the company <COMPANY>Intra Extra Digital Ltd.</COMPANY> and some more text.</PARA> Fredrik Lindgren Upright Engineering Publ.